posted 15 years ago
I think your result is:
here
james
The explanation of this result is as following:
Every class extends java.lang.Object. You created an Object class in a different package. This is why you don't see 'james' when you're initializing a 'objecttest' object.
The new Object() statement creates in instance of you own Object class, because the compiler probably checks first if an Object class exists in the same package as the Objecttest class. If this class does not exists in the current package, the Object class of package java.lang will be used.