Thursday, March 12, 2009

Since Object class is the super class of every class in java and suppose if I

Question :Since Object class is the super class of every class in java and suppose if I
write class x extends y and this class x also extending Object,
Is this multiple Inheritance ? (CoreJava)

Answer :When you write "public class x" which doesn't extend any other class by
default x is extending Object.
When you write "public class x extends y" x is extending y and y is
extending Object class
Your class can extend only one class.

No comments: