Howdy! Today I came across a little code that calls a method from it's superclass with no dot operator like this: MyThread(String Name) { setName(name); } and then again later: System.out.println( getName() );
Now I thought you couldn't do that! How does this work? -Paul
That's the whole point of inheritance. When you extend another class you inherit ALL the members of the base class. The only ACCESSIBLE ones are those that are declared protected, public or default (if the dervied class is in the same package). The methods appear as if they are defined in the dervied class. Shah.