Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Broad Liyn Newsgroups: comp.lang.java.programmer Subject: Re: unchecked conversion warning. Date: Sun, 10 Jun 2012 21:52:23 -0700 (PDT) Organization: http://groups.google.com Lines: 35 Message-ID: <265ea956-a3ed-4e76-8fc9-9ce9728f6b37@googlegroups.com> References: <3s7cs7hd18l0ffci55ns0286n4lc4cutlu@4ax.com> NNTP-Posting-Host: 124.90.212.120 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1339390344 13875 127.0.0.1 (11 Jun 2012 04:52:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 11 Jun 2012 04:52:24 +0000 (UTC) In-Reply-To: <3s7cs7hd18l0ffci55ns0286n4lc4cutlu@4ax.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=124.90.212.120; posting-account=ZqBWVwoAAAD9GyoEs0nPtgdheCcML1v7 User-Agent: G2/1.0 Xref: csiph.com comp.lang.java.programmer:15201 =E5=9C=A8 2012=E5=B9=B45=E6=9C=8830=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89UTC+= 8=E4=B8=8B=E5=8D=889=E6=97=B632=E5=88=8643=E7=A7=92=EF=BC=8C=EF=BC=88=E6=9C= =AA=E7=9F=A5=EF=BC=89=E5=86=99=E9=81=93=EF=BC=9A > This code compiles with an 'unchecked conversion' warning. > I have tried various corrections, for example casting like (Vector), but to no > avail. > What am I doing wrong?l > The code is the smallest demo I could make from the original application. >=20 > import java.util.Vector; > public class genericsdemo > { > private static Vector vdata =3D new Vector(); //a Vecto= r of Vectors > private static Vector vrow =3D new Vector(); //a row >=20 > public static void main(String args[]) { > vrow.add(null); //two columns in the row > vrow.add(null); >=20 > vdata.add(vrow); //add the row to the Vector of Vectors >=20 > Vector vtmp =3D getrow(); //test > } >=20 > private static Vector getrow() { > return vdata.elementAt(0); //warning: [unchecked] unchecked conversi= on > } > } >=20 > JensJ 1.vector is no longer being supported. 2.