This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes JLS understanding... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "JLS understanding..." Watch "JLS understanding..." New topic

JLS understanding...

Santhosh Kumar
Ranch Hand

Joined: Nov 07, 2000
Posts: 242
Hi, JLS says
From any array type SC[] to any array type TC[], provided that SC and TC are reference types and there is a widening conversion from SC to TC.
is widening conversion. I tried,
int a[] = new int[10];
long l[];
l = a;
it throwning compile error. Can some body tell me the meaning of the above sentence?
Maha Sam

Joined: Nov 27, 2000
Posts: 5
I think you should read it carefully it say reference types and not primitive types.What you are trying to do is with primitive types thus giving you the compile time error.
I agree. Here's the link:
subject: JLS understanding...
Similar Threads
parameter passing question for array reference
JLS understanding...
Need Help
Widening Reference Conversation