GeeCON Prague 2014*
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

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.
GeeCON Prague 2014
subject: JLS understanding...