The shortcut key for java output statement is to enter syso and press [alt /]: first import the package; then create the object in the main function; finally output the string, use the shortcut key [alt /].
The shortcut key for java output statement is to enter syso and press [alt /]
First: import the package import java.util.Scanner;
Then: create the object in the main function, eg: Scanner input=new Scanner(System.in);
Finally, if you want to input a string, String a=input.next();
If you want to enter an integer, then int b=input.nextInt();
Don’t forget to add input after writing the input statement. close(); otherwise there will be a warning, which may cause memory leaks later.
Output: String: System.out.println("love");
Integer: System.out.print("123");
Output shortcut keys : After entering syso, press alt /
Related learning recommendations:java basic tutorial
The above is the detailed content of What is the shortcut key for java output statement?. For more information, please follow other related articles on the PHP Chinese website!