Why Object is base class in java language?
Solution(By Examveda Team)
java.lang.Object class is the super base class of all Java classes. Every other Java classes descends from Object.
If a class is declared without extending another class then it will implicitly extend Object class. This is taken care of by the JVM. This is not applicable for the interfaces. A Java interface does not extends the Object.
Following could be the reasons for this design decision,
1.By having the Object as the super class of all Java classes, without knowing the type we can pass around objects using the Object declaration.
2.Before generics was introduced, imagine the state of heterogeneous Java collections. A collection class like ArrayList allows to store any type of classes. It was made possible only by Object class hierarchy.
3. The other reason would be to bring a common blueprint for all classes and have some list of functions same among them. I am referring to methods like hashCode(), clone(), toString() and methods for threading which is defined in Object class.
Which of the following is not a primary function of a Bank?
A. Granting Loans
B. Collecting Cheques/Drafts customers
C. Facilitating import of goods
D. Issuing Bank Drafts
A. Regulatory jurisdictional fight between SEBI and IRDA
B. They don’t offer better tax benefits
C. They offer lesser returns compared to traditional insurance policies
D. All of the above
The Chameli Devi Jain Award is given for an outstanding woman ____?
A. Scientist
B. Reporter
C. Player
D. Teacher
Join The Discussion