Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 18 Feb 2013 04:59:02 -0600 Date: Mon, 18 Feb 2013 12:58:22 +0200 From: Donkey Hottie User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: abbreviated generic syntax References: <0h93i8pcopf17145fus96g7vams86hocat@4ax.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: Lines: 28 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-8kgQgxYSs4uLJ44Wk56PSeeSxsX5buFvkAHFM4IBcq67YoeoL+Ec8piXksCr1OGgOaYuop0LBYVCZTl!a/Fpru2TuMzgEn6U6dcBrIZcHHg/4rDJ86BX+dk4dUPlCPR9B1OsVtToV5oWXTYiJwem X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1995 Xref: csiph.com comp.lang.java.programmer:22342 18.02.2013 11:41, Barb Knox kirjoitti: > In article <0h93i8pcopf17145fus96g7vams86hocat@4ax.com>, > Roedy Green wrote: > >> In generics in Java 1.7 you can abbreviate >> >> ArrayList a = new ArrayList( 100 ); >> >> as >> >> ArrayList a = new ArrayList<>( 100 ); >> >> Would any code have broken if you abbreviated like this instead: >> >> ArrayList a = new ArrayList( 100 ); >> >> If not, why the <>? > > I expect that a "new ArrayList(100)" returns an ArrayList of Objects. > It has an storage arrangement for 100 object references (and Strings ARE Objects), but it does not allocate any Objecs nor Strings in that initialization. -- You will pass away very quickly.