Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #25853
| From | markspace <nospam@nowhere.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: limitations on using enum as generic parameter |
| Date | 2011-02-08 12:40 -0800 |
| Organization | A noiseless patient Spider |
| Message-ID | <iis9oh$71p$1@news.eternal-september.org> (permalink) |
| References | (1 earlier) <iis2c4$egq$1@news.eternal-september.org> <c93f15ae-9766-42f3-9bb0-18cea537e111@u14g2000vbg.googlegroups.com> <7119305a-64ef-4706-adc2-ad06fc2064bc@w19g2000yqa.googlegroups.com> <1b51d5bf-2de0-4133-baeb-03282cbeaccf@p16g2000vbo.googlegroups.com> <2d91a230-489b-48fe-b7cb-e282b967e714@n10g2000yqf.googlegroups.com> |
On 2/8/2011 11:44 AM, dalamb@cs.queensu.ca wrote: > I can switch to using an ArrayList, though. You don't need to in this instance. values() and getEnumConstants() both return an array of the proper type, so the dirty work has been done for you. Actually, "don't mix arrays and generics" is far to strong. There's no reason not to mix them. There's only a couple of edge cases where you have to do funny things with compiler directives. Your usage here is just fine.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Re: limitations on using enum as generic parameter "dalamb@cs.queensu.ca" <david.alex.lamb@gmail.com> - 2011-02-08 11:13 -0800
Re: limitations on using enum as generic parameter Lew <lew@lewscanon.com> - 2011-02-08 11:22 -0800
Re: limitations on using enum as generic parameter markspace <nospam@nowhere.com> - 2011-02-08 12:40 -0800
Re: limitations on using enum as generic parameter "dalamb@cs.queensu.ca" <david.alex.lamb@gmail.com> - 2011-02-08 11:44 -0800
csiph-web