Home  >  Article  >  Java  >  What is the shortcut key for java output statement?

What is the shortcut key for java output statement?

coldplay.xixi
coldplay.xixiOriginal
2020-10-23 11:56:3119345browse

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 /].

What is the shortcut key for java output statement?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn