Thoughts on unified integer literal improvements

Max (Weijun) Wang Weijun.Wang at Sun.COM
Tue Jun 30 04:13:56 PDT 2009


On Jun 30, 2009, at 7:05 PM, abies at adres.pl wrote:

>
>
> "Max (Weijun) Wang" <Weijun.Wang at Sun.COM> napisał(a):
>
>> How about a step further like --
>>
>>    byte[] bs = 0x0102030405060708AABBCCDDEEFFy;
>>
>
> Which direction it would be read? byte[0] is 0x01 or 0x0FF ?

0x01

>
> What with byte[] bs = 0xabcy; ? Would it be legal - and would it be  
> equivalent to 0x0abcy, 0xa0bcy, 0xabc0y ?

Illegal. In fact,

     byte b = 0x1y;      // maybe illegal.
     byte[] b = 0xABy;	// illegal. The array literal must be at least  
length 2.

Max

>
> I understand that it would be kind of byte[] literal, so no  
> possibility of overwriting contents of existing byte array, short of  
> using
> System.arraycopy(0x0102030405060708AABBCCDDEEFFy,0,bs,0,14);
> ?
>
>
> Regards,
> Artur




More information about the coin-dev mailing list