Original Post
Given these two example classes, what would you say the print out would be if you run "java Child" on the command line after compiling the 2 classes? I've just found out about this wierdness and wondered if anyone else knew about it? I'll explain once the correct answer is posted..
public abstract class DaddyClass extends Object
{
public DaddyClass(String arg)
{
foo(arg);
}
public abstract void foo(String arg);
}
public class Child extends DaddyClass
{
private String m_stuff = null;
public Child(String subject)
{
super(subject);
}
public void foo(String arg)
{
m_stuff = arg.toLowerCase();
}
public String getStuff()
{
return m_stuff;
}
public static void main(String[] args)
{
Child child = new Child("Who's your daddy?");
System.out.println(child.getStuff());
}
}