强行把一个Null的Integer赋给一个int变量

What will happen? 

		Integer a = null;		
		int b = a;
		System.out.println(b);

答案:最后一行会报空指针异常

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.