answersLogoWhite

0


Best Answer

Java is an object oriented language, which means that one of its core principles is inheritance. All classes (and hence the objects created from them) are derived from a parent. In this way, classes inherit variables, methods, and classes from their parent so that they do not have to redefine them. In Java's case, the common parent of all classes is Object. This gives every class some basic functionality, such as the equals, toString, and wait methods. Besides uniformity, another advantage of inheritance is clear organization. Imagine if we could not guarantee the comparison of two objects with the equals method. Finally, a global parent class means that every class, no matter how specific, can be generalized into the parent's type (Object o = new String()).

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why do all java objects have a common ancestor?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

Which organisms have possible common ancestor?

All of them


The fact that all organisms have DNA as their genetic material is evidence that?

We all current life has a single common ancestor.


What was LU-CA?

LUCA stands for Last Universal Common Ancestor, the last organism that is the common ancestor of all life on Earth.


Why java is not a complete object oriented language?

Java is not a completely object oriented language, because not all values in Java are Objects. For example, the basic numeric types such as int, long, double, etc., are not objects and need to be "boxed" into objects in order to pass them as Object parameters or call methods on them.


Why comparator has equals method?

The Java superclass Object says that all Java objects have an equals method. Thus Comparator has an equals method.


What is the common ancestor of the leopard and cheetah?

A bobcat is a specie of lynx, which is a member of the family Felidae or cat family.


Do birds and reptiles share a common ancestor?

Yes. If you go back far enough, all life on Earth shares a common ancestor.


What primate is the relative to the common ancestor of all primates?

lemur


Do the primitive datatypes in java have objects?

No Primitive data types do not have objects. As of Java 1.5, all primitive types in Java have "wrapper" classes. These classes serve two purposes: # They keep all type-specific methods together in one place. # They allow primitive types to be used in situations which take advantage of generics (also introduced in Java 1.5).


What is the principle that states that all species have descended from a common ancestor?

yes, theses ancestors are called common decent


What are you to your aunts mother in law?

You could be their grandchild. Or you may not be related at all, as not sharing a common ancestor.


What primate is the closest relative to the common ancestor of all primates?

lemur