Path: csiph.com!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail From: Jens Newsgroups: comp.lang.java.programmer Subject: unchecked conversion warning. Date: Wed, 30 May 2012 15:32:43 +0200 Message-ID: <3s7cs7hd18l0ffci55ns0286n4lc4cutlu@4ax.com> X-Newsreader: Forte Agent 4.1/32.1088 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 27 Organization: SunSITE.dk - Supporting Open source NNTP-Posting-Host: 77.215.172.9 X-Trace: news.sunsite.dk DXC=NS\8MlJVPcoNC=2oJ9U:hfYSB=nbEKnkkRh@WnOf_4Ka@e_G2CQGhXa`6X?e:2LnHgU;0T`M;JNIco3kM^dAI0km3]=6[T33H]g X-Complaints-To: staff@sunsite.dk Xref: csiph.com comp.lang.java.programmer:14939 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. import java.util.Vector; public class genericsdemo { private static Vector vdata = new Vector(); //a Vector of Vectors private static Vector vrow = new Vector(); //a row public static void main(String args[]) { vrow.add(null); //two columns in the row vrow.add(null); vdata.add(vrow); //add the row to the Vector of Vectors Vector vtmp = getrow(); //test } private static Vector getrow() { return vdata.elementAt(0); //warning: [unchecked] unchecked conversion } } JensJ