jQuery in Action, 2nd edition*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes short vs short array inconsistency? 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 "short vs short array inconsistency?" Watch "short vs short array inconsistency?" New topic
Author

short vs short array inconsistency?

Arnab Sunny Rakshit
Greenhorn

Joined: Jun 07, 2013
Posts: 19

why does the short array assignment work but the short assignment not work?



However if I do this then compiler ain't happy !



Does this mean that an auto cast (from wider to leaner) is happening when array elements are initialized? But no such downcast happens during plain primitive assignment?
Arnab Sunny Rakshit
Greenhorn

Joined: Jun 07, 2013
Posts: 19

Please disregard. I misinterpreted the above.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: short vs short array inconsistency?
 
Similar Threads
Casting
how to assign some numeric values like 1 ... to a short variable ?
Question on primitive
Casting question
my notes on JLS for any1 who needs them !!