Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java Generics broken beyond repair?




On Dec 13, 2006, at 7:59 AM, Aeon B. C. Lee wrote:

Can anyone tell me what's wrong with the last statement of my code?


If you can do getClass() on whatever Object is on your stack it seems like...


byte[] b = (byte[])java.lang.reflect.Array.newInstance (byte.class, 10); // This is OK
System.out.println(Array.create(Byte.class, 10)); // So is this
System.out.println(Array.create(b.getClass(), 10)); // WTF is wrong with this?


should work...

java NewMain
[Ljava.lang.Byte;@2e7263
[[B@57f0dc

The [[B is a little different - an array of array of something? Might not be right after all, you'd need to test.


Mike Hall mikehall at spacestar dot net http://www.spacestar.net/users/mikehall http://sourceforge.net/projects/macnative



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Java Generics broken beyond repair? (From: "Aeon B. C. Lee" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.