• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JLS understanding...

 
Santhosh Kumar
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
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.
Sam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic