2.Use while (Boolean) {strings s = sc。 next(); } this way to judge whether the input meets the conditions you want.
3. The variable modified by 3.final has a special property: the value cannot be changed after assignment, so it is called constant in JAVA. For example, the circular area s = r 2 * π. π is a constant value, and finally double x = 3.14 can be used at this time; To create.
4. Whether the plastic direct comparison values are equal. Reference type variable = = compares whether the memory addresses of the two variables are equal, that is, whether they point to the same object. The equals method is to determine whether the contents of two variables are the same, regardless of the memory address. This is the default.
string s 1 = " 1 1 1 1 ";
String S2 = new String(" 1 1 1 1 ");
system . out . println(s 1 = = S2);
system . out . println(s 1 . equals(S2));
The outputs are false and true respectively.