Java foundation 06 (6 types of operators)
Arithmetic operator
Precautions for arithmetic operators
1. The sign of the result is the same as that of the module2. In development, we often use% to judge whether it can be eliminated3. "+" can be a connector. In addition to the string addition function, it can convert non string into string.
For example:
System.out.print ...
Added by franknu on Sat, 15 Jan 2022 12:21:32 +0200
Java foundation 05 (program flow control)
Scanner: get different types of variables from the keyboard
Specific implementation steps
① Guide Package
import java.util.Scanner;
② Instantiation of Scanner:
Scanner scan = new Scanner(System.in);
③ Call the relevant methods of the Scanner class to obtain the specified type
int age = scan.nextInt();
System.out.println(age);
...
Added by nexgen_x on Fri, 19 Nov 2021 11:03:53 +0200
Details of the use of Javafinal, static, anonymous inner classes, and modifiers
final keyword
The emergence of inheritance improves the reusability of code and facilitates development. However, there are also problems. Some classes do not want to be inherited after description, or some method functions in some classes are fixed and do not want subclasses to be overridden. However, when subclasses inherit these special ...
Added by LankyMac on Wed, 27 Oct 2021 02:59:59 +0300