Chapter One (PTA Review)

Chapter One Two

Insert picture description here

Insert picture description here
Insert picture description here

Because 3 is shaping by default, the shaping length is greater than the short type. If short type = short type + int type, it may overflow, so compile errors will be reported.
For example:Insert picture description here
Insert picture description here

Insert picture description here

Answer: The variable type in the D switch statement can be byte, short, int or char. Starting from Java SE 7, switch supports the String type, and the case label must be a string constant or literal.
Insert picture description here
Answer: D because the program is not executed to ((Output+=10)==20) here

Guess you like

Origin blog.csdn.net/qq_43907296/article/details/109499622