Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: setSize ArrayList, when will it come? Date: Tue, 09 Aug 2011 09:42:21 +0200 Organization: albasani.net Lines: 56 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net lw5IFhaH7PfI2cGAMuLw3Zn153e6slHmQIBjDD3KtUOxPieP51U8hrOwGThUM1JvMEOmFe8VHghVcbeU0Pe+Ng== NNTP-Posting-Date: Tue, 9 Aug 2011 07:42:24 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="xsMFUq7omSq25jILEgESYhJpAziZ8D1oHEKnE2Zo0EfjbBKVhnxJlvehVt1lyyR8OcrQAUrUaimf5v7Jx394T50eia5emrvbvahbsOtSZbFjopyWUTfp2uhxPVUhFdcV"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110706 Firefox/5.0 SeaMonkey/2.2 In-Reply-To: Cancel-Lock: sha1:ozZ5HmtNEC8Dcs6fEWKxwhpQZ3g= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6899 But: Before: Vector a = new Vector(); Vector b = new Vector(); b.setSize(3); System.out.println(a.getClass() == b.getClass()); returns true. After: (Since b makes use of setSize(). I can only replace a with an ArrayList) ArrayList a = new ArrayList (); Vector b = new Vector(); b.setSize(3); System.out.println(a.getClass() == b.getClass()); returns false; More than annoying, brainless. Best Regards Jan Burse schrieb: > Joshua Cranmer schrieb: >> >> returns false. > > And where is the drop-in manipulation, what was the before and after? > I understand what you are heading for, the morning star is not > evening star, yet they are the same. > > But typical scenario would be: > > Before: > > Object a = new Vector(); > Object b = new Vector(); > System.out.println(a.getClass() == b.getClass()); > > returns true. > > After: > > Object a = new ArrayList(); > Object b = new ArrayList(); > System.out.println(a.getClass() == b.getClass()); > > returns true. > >