1 , A semicolon must be added after the end of a line; this is an English semicolon. ,
2 , When importing the package, use import java.util.math directly, that is, import the package directly
importstatic java.lang.Math.*;//Static import
This is a static import. When using it, you can directly use the method name in this class. System.out.println("random number:"+random());
It cannot be used directly without writing.
3 import java.util.Scanner;
Scanner sc = new Scanner(System.in);
System.out.print("Principal:");
int money=sc.nextInt();
Use the above method to enter what you want to enter in cmd
1 , No need to add a semicolon at the end of a line
2 , When importing the package, you can directly use the import to import the package. class, or you can use the from package import class
3 , Content = input("The content that needs to be translated:") So you can enter things yourself in the console, and the entered things can be saved in content, so that you can use your own input later
4 , To judge whether the values are equal, use == to judge whether the values are equal, the returned result is a bool type result, True means the values are equal, False means the values are not equal. Then use is to verify whether the memory address, type, and value are consistent
Recommended Posts