Learning java third day

The program calculates the square
R & lt * = R & lt Math.pow (R & lt, 2) the PI *
Math.pow (digital, digital top right corner)

The main method = master method = entry functions
method = Function
Shortcut Key: cyrl + /: single-line comment, solutions comment
alt + /: completion, automatically prompts
the Ctrl +. 1:
Alt + arrow keys: mobile code
ctrl + s: Save
ctrl + z: undo
ctrl + c: copy
ctrl + v: paste
shift + tab: to the left

Java standard language standard input output
standard output: println (): ln ==> line: the line output and wrap quickly: syso + (alt + /: Auto Completion)
Print: no newline
escape character: \ t: a tab key space distance \ n: line feed
\ distance t is not fixed, the composition of his data with previous data in units of node 8

Standard Input steps:
1. Create the input object (lead package):
Scanner the INPUT = new new Scanner (System.in);
2. prompted to enter
System.out.println ( "Please enter your name:");
3. Call the appropriate the method of receiving data
String name = input.next ();
4. output user data
System.out.println (name);

Common methods:
1. Next (); Get string data space can not be obtained
2.nextLine (); string, can acquire data space, carriage return line may be acquired
Note: a first input must be placed in the middle would be if receive data on the transport line
3.nextInt (); accepts int integer
4.nextLong ();
5.next.charAt (0); obtaining the first character such as: gender
, etc.

Published 12 original articles · won praise 0 · Views 33

Guess you like

Origin blog.csdn.net/qq_45212924/article/details/104415102