Possible error in the Java Language Specifications

TechnoTux techno2055 at yandex.com
Mon Feb 22 13:32:37 UTC 2016


Hi,

in the java language SE 8 specification located at: http://docs.oracle.com/javase/specs/index.html
in chapter 5 "Conversions and Contexts", page 119: in the Table 5.5-B. Casting conversions to reference types

according to the table numeric reference types (Byte Short Character Integer Long Float Double) don't have casting conversion allowed to primitive value types
now looking at the following code:

Short ShortNum = 0;
double doubleNum = 0;

doubleNum = ShortNum;

we see that Short converted to double which is primitive ..




now if i may ask, if my point isn't correct and there is no error in the specifications and since i'm trying to get the OCA 8 certificate then please tell me what the Specification meant by no casting conversion allowed ...?


More information about the jls-jvms-spec-comments mailing list