标签:static 输入 mil import stat int obj family system
import java.util.Scanner;
public class AnonyObjects {
public static void main(String[] args) {
int i = new Scanner(System.in).nextInt();//匿名对象
System.out.println(i);
method(new Scanner(System.in));
Scanner j=method1();
System.out.println("输入的是"+j);
}
public static void method(Scanner sc){
int num =sc.nextInt();
System.out.println("输入的是"+num);
}
public static Scanner method1(){
return new Scanner(System.in);
}
}
标签:static 输入 mil import stat int obj family system
原文地址:https://www.cnblogs.com/xzwx668/p/12046481.html