A Java Interview Puzzle.

前天和Morgan讨论C#和Java的异同时,伙同其随意编出如下Java面试题一道:

 

What will be the output of the following program?


class ABC
{
	public ABC()
	{
		System.out.println("A");
	}
}

public class Sequence extends ABC
{
	{
		System.out.println("B");
	}

	static
	{
		System.out.println("C");
	}

	public Sequence()
	{
		System.out.println("D");
	}

	public static void main(String argv[])
	{
		System.out.println("E");
		Sequence seq = new Sequence();
	}
}

4 comments to A Java Interview Puzzle.

Leave a Reply

 

 

 

You can use these HTML tags

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