Package Com.yuan.test;public class Autogrew {public static void main (string[] args) {//The constant that holds the maximum value for short, the maximum value is 215-1. (32 767)//The constant that holds the minimum value of short, the minimum value is-215. ( -32 768) short s1=11278; S1+=1; s1=s1+1;//error will automatically be converted to int type System.out.println (S1); The value is a constant of 2 31 square-1, which represents the maximum value that the int type can represent. The value is a constant of 2 31, which represents the minimum value that the int type can represent. A constant that holds the desired maximum value of the byte type, which is 2 7 square-1. (127)//A constant that holds the minimum value of the byte type, that is, 2 7 times. (-128)}}
ForShort S1 = 1; S1 = s1 + 1;BecauseS1+1Operation, you willTypes of auto-lifted expressions, so the result isInt
Type, and then assign a value toShortTypeS1When The compiler will report errors that require a cast type
due to += is java processing, so you can Span style= "FONT-SIZE:11PT; Color:rgb (0, 0, 255); " > correctly compiled
2、CharA Chinese character can be stored in a type variable?Why?
CharType variable is used toStoreUnicodeCodingof the characters,UnicodeThe encoded character set contains the kanji, so,
Char
char Supplementary note:
char note: The latter part of the answer, although not in the positive answer, but, in order to show their knowledge and performance of their own to
A thorough understanding of the problem, can answer some relevant knowledge, do sparing, liker.
There are several types of Java common Type range description, char variable can not be stored in a Chinese character