java Primer: Hello World

the HelloWorld class {public
public static void main (String [] args) {
// Print terminal World Hello
System.out.println ( "Hello World Fengqiao_X the I AM..");

// get an integer from the keyboard
System.out. println ( "Please enter an integer:");
Scanner Scanner new new = S (the System.in);
int s.nextInt a = ();
System.out.println ( "first integer:" + a);

/ / a floating-point number obtained from the keyboard
System.out.println ( "Please enter a floating-point number:");
a float s.nextFloat B = ();
System.out.println ( "floating-point number is read:" B +);

// get a string from the keyboard
System.out.println ( "enter a string:");
string s.nextLine C = ();
string s.nextLine D = ();
the System.out .println ( "string is read:" + D);
}
}

Guess you like

Origin www.cnblogs.com/Fengqiao-X/p/Java_hello.html