1. The rules for Java identifiers are like this
Identifiers consist of letters, numbers, underscores "_", dollar Sign "$" or the renminbi symbol "¥", and the first letter cannot be a number. That is, in addition to _ $¥ these 3 symbols, identifiers can only have numbers and letters, what parentheses, so that is not part of the identifier.
You cannot use keywords and reserved words as identifiers.
Identifiers do not have a length limit.
String $;
String Y2;
String idfkd$fff;
String ADKYDKJK;
String _DJFKDJ;
String dkjfkdj_dfe;
String f444d;
2. When you define an array in Java, you cannot specify both length and initialization.
string[] STRs = new string[3]{"abc", "Dee", "FFF"}//This is wrong
3, Java = = logical expression on both sides of the type must be convertible to the same type of variable, that can be automatically type promotion (conversion), or compile error
int i = 3;
String str = "3";
if (i = = str)//This sentence will be error when compiling
{......}
4, in Java, the byte variable can be assigned a value of 0-255, more than 255 must use coercion type conversion, or compile error
For example: byte = 120; That's right
byte = 300; This is wrong.
5. The average array is printed by SYSTEM.OUT.PRINTLN () as the memory address value and the group type. With the exception of the character array, it prints the result of the string itself.
For example: char[] CHS ={' A ', ' B ', ' C '};
System.out.println (CHS);//print Result: ABC
int[] numbers = new int[]{2,3,4,5};
SYSTEM.OUT.PRINTLN (numbers); Print result: [[email protected]
Java Basic Syntax Tip summary: (one quiz)