kyoto dreams
Thursday, January 05, 2006
  One Consider the code below.

1. Will it compile?
2. If so what is the output?
3. If not, why not, and how would you fix it?





public class Foo {
private int count = 1;

public static void main(String []args) {
new Bar();
}
}

class Bar extends Foo {
public Bar() {
System.out.println(count);
}
}
 
Comments: Post a Comment

<< Home

ARCHIVES
May 2005 / June 2005 / August 2005 / January 2006 / March 2006 /


Powered by Blogger