Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Using Enumerated Types as Array Indexes Date: Tue, 16 Aug 2011 20:20:05 -0700 Organization: A noiseless patient Spider Lines: 9 Message-ID: References: <4e4b0d81$0$314$14726298@news.sunsite.dk> <4e4b1fe4$0$314$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 17 Aug 2011 03:20:17 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="11571"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/W/RaElxYkQhg/CnroY0OPzFnuxY0o8wk=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: <4e4b1fe4$0$314$14726298@news.sunsite.dk> Cancel-Lock: sha1:GRJ0V1PZ7x+khaJ3+GraY8u+R9c= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7152 On 8/16/2011 6:56 PM, Arne Vajhøj wrote: > byte/short/int/long integer types OK, you mean for indexes? char works too, and long really doesn't -- it has to be cast to an int. For longs, Java recognizes the loss of precision using long and requires that you acknowledge that the upper bits will simply be truncated.