Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Object [] obj = {"String",10};

807599Nov 18 2006 — edited Nov 18 2006
Sorry i am new to java will trying to understand the below code for reflection i came across a line.


code]
Object [] obj = {"String",10};


i am unable to understand as this is array of Object type
however 10 is int a premative type how can a referance type
array excepts int (a primative type value).The code is perfect and its getting complied.
[
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 16 2006
Added on Nov 18 2006
3 comments
159 views