No (4) I was in accordance with the chapter, the fourth chapter is not good to organize, pay attention to
switch:1, can only be judged as equivalent 2, can only match int and Char
Input.hasnextint (); Determines whether the input value is a number is a number returned true not a number returns false
Debug 3 steps: 1, set breakpoint 2, start debugging 3, observe variables
Equals: used to compare strings
Scanner input=new Scanner (system.in);
String ok= "n";//default Teacher not satisfied
While (ok.equals ("n")) {
System.out.println ("see theory in the morning");
System.out.println ("the Afternoon Knock code");
System.out.print ("\ N qualified? y/n:");
Ok=input.next ();
}
System.out.println ("qualified!") ");
While and do while Loops:
While (condition) {...} ==>while Loop features: first judgment and execution
do{....} While (condition); ==>do. While loop features: first execution after judgment
Reverse Output:
int a=12345;
System.out.println (a);
While (a!=0) {
int Y=A%10;//1
System.out.print (y);//54321
a=a/10;//0
}
For (initialize; condition; accumulate, Subtract) {...}
For (1;2;4) {//the order of execution is: 1234234234234234234234 .....
3
}
For (int I=1;i<=100;i++) {//101
System.out.println ("+i+" time to study well!) ");
}
Break: End the entire loop
Continue: ends the current loop and goes directly to the next loop
Using Java to understand program logic (5)