short_Keyword 浅浅的花香味﹌ 2021-11-04 13:56 311阅读 0赞 ## short Java Keyword with Examples ## Key points about short Java Keyword * The short keyword is used to declare a variable as a numeric type. * short is a signed 16-bit type. * It has a range from –32,768 to 32,767. * The Short class is a wrapper class for the short primitive type. It defines MIN\_VALUE and MAX\_VALUE constants representing the range of values for this type. ### short Java Keyword Example ### Here are some examples of short variable declarations: short s; short t; Here are some examples of short variable declaration and initialization: short length = 20120; short flag = 10; The short keyword can be used to the declared return type of a method as well: public short getLength() { return 20; }
还没有评论,来说两句吧...