About content and feelings of self-java

This week the self-knowledge of java input: input method java with c ++ and c is somewhat different, he needs to import packet connection system can be written statement entered at the beginning of a plus.

I have written a simple program that inputs:

package mode2;
import java.util.Scanner;
//import java.util.Scanner;
public class mode2 {
//public static void main(String[] args) {
// Scanner nb = new Scanner(System.in);
// System.out.println("请输入数值:");
// int i = nb.nextInt();
// System.out.println(i);
// nb.close();
//}
public static void main(String[] args) {
Scanner a = new Scanner(System.in);
System.out.println("请输入你k的值:");
int k = a.nextInt();
for(int i=0;i<k;i++) {
System.out.println("hello world");
a.close();
}
}
}

Holidays are soon over, about java also have a preliminary understanding. After school will study hard!

Guess you like

Origin www.cnblogs.com/yangxionghao/p/11441429.html