+ 1
Why object class is parent of every class
4 Respuestas
+ 1
"Every class is a descendant, direct or indirect, of the Object class."
reference source-
https://docs.oracle.com/javase/tutorial/java/IandI/objectclass.html
0
but why
0
There 12 instance methods that are properties of the Object class and each one performs a specific task when invoked. Due to inheritance, any class created in Java has access to these 12 methods thus allowing code reuse as opposed to rewriting code.
"Inheritance lets programmers create new classes that share some of the attributes of existing classes. This lets us build on previous work without reinventing the wheel."
source - https://stackify.com/oops-concepts-in-java/
Follow link below for description of the 12 instance methods of Object class.
https://docs.oracle.com/javase/tutorial/java/IandI/objectclass.html
0
thank you