We know that in java all classes extends Object. but Object itself is a class in java. so is this class also extends by itself or any other class?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No,
java.lang.Objectdoesn’t extend anything. If you ask Object.class for its superclass, it will return null.It would be more accurate to say that every class except
Objectinherits directly or indirectly fromObject. The wording of the Java Language Specification says:and also: