Learning java Road 3

Instant week passed, time rush dies, nothing left.

This week, I learned the process control, mainly because some conditional statements and the use of loop; spent about three hours to solve the problem, the code is two hours, five hours on learning of new knowledge;

Learn new things, like c, c ++ does not, the next loop nest, break out of only the innermost loop, but there is a way, can jump out of the outer loop, thinking out of the loop for the front plus the tag name , such as loop: loop {break loop;} adjustable out of this loop;

Also addresses a problem with java programming, inside need to use input statements, newline statements, and print diamond thinking, 

Let me talk about the java input data:

package package name;

import java.util. *;

{public class name of the class

public static void main (String [] args){

Scanner sc (sc free to change) = new Scanner (System.in);

System.out.println ( "Please enter an integer n:");

int n = sc.nextInt (); (capital letters beginning int)

}

}

Of course, only the A data input java, I feel very good with this, so I used this anymore;

Wrap statement:

System.out.println (); corresponds System.out.print ( "\ n");

System.out.println("\n");

System.out.println (); ln have a wrap;

java even for two rows may be as: System.out.println ( "\ n \ n"); (even for the three lines, three)

This is the basis of what I learned this week, some of the basics of programming in java.

Next week program to learn string.

Guess you like

Origin www.cnblogs.com/022414ls/p/11220144.html