继续转载当年的坑系列,这个系列的题目都是当年从各种坑中收集而来的。

 


	public class Test23 {
		static {
			name = "B";
		}
		static String name = "A";
		static {
			System.out.println(name);
		}
	
		public Test23() {
			System.out.println("初始化" + name);
		}
	
		public static void main(String[] args) {
	
		}
	}

会输出什么?
答案:

A

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

required

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