如static int x= object .nextInt()会出错
public class outer { static int test; static{ test = new Scanner(System.in).nextInt(); System.out.println(test); } public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(test); } }