Manfred,
i agree with your answer.
But i am yet not clear with my first question.
Could u give an example.
Regarding my 2nd question ,could u tell me whether this is overiding.
public class StaticOverridingTest {
public static void main(
String s[]) {
Parent p =new Parent()
p.dostuff();
Child c=new Child()
c.dostuff();
p=c;
p.dostuff();
}
}
class Parent {
static int x = 100;
public static void doStuff() {
System.out.println("In Parent..doStuff");
System.out.println(x);
}
}
class Child extends Parent {
static int x = 200;
public static void doStuff() {
System.out.println("In Child..doStuff");
System.out.println(x);
}
}
File writer will also create a file if it does not exist.
I hope i am right.