Public classHello {/** * * * * * * @param args*/ Public Static voidMain (string[] args) {String _$dd123="";//Defining Variables inti; I=123;//semicolon to note is the English semicolon intm=1, n=2, x=4, y=5;//It's best to write separatelyFinalDoublePAI =3.14;//constants are assigned once, cannot be changed, and constant names are generally all uppercase//pai = 3.1415926;i=ddd; This will be an error, constants cannot be changedString strUserName="Tom lives in this room ."; System. out. println (strUserName); strUserName="Zhang San lives in this room ."; System. out. println (strUserName); byteb =127;//Range-128 to 127 Shorts =2; intj =123; LongL =1234L;//The trailing flag L is determined to be a long type intc = (int)1234l;//cast, show conversion LongLL =b; floatf =123.45f;//you need to mark the end of the number with an "F" DoubleD =12345; F= (float) D;//cast, must be of the relevant data type to be convertedF=l; Charv ='a';//single quote "' cause your single character to intA =v; System. out. println ("A ="+a); Charg =98; System. out. println ("g ="+g); Boolean T=true;//logic True, both true and false are lowercaseT=false;//Logical False//TODO Auto-generated method stubs
Constants, variables, data types wrong n+1 times.