answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Can an object be a subclass of another object?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

Is every class in java is subclass of itself?

A class can be a subclass of another class, not of itself.A class can be a subclass of another class, not of itself.A class can be a subclass of another class, not of itself.A class can be a subclass of another class, not of itself.


When a subclass can call a parent's class constructor?

A subclass invokes its base class constructor at the point of instantiation. That is; you cannot instantiate a subclass object without first constructing its base class, which is done automatically.


Which object-oriented concept defines the relationship between a subclass and a super class?

Inheritance


What is heritance in java?

With inheritance, you can use methods and fields from the superclass in a subclass. So for example when I have a class Person with fields age and gender, I can make a subclass Student. a Student object has always the fields from its superclass Person (age and gender), but you can make extra fields for a Student object. The same is true for methods: a method defined in the Person class can also be used on a Student object because Student is a subclass from Person. Got it? ;)


What is object overridding?

Overriding is an Object-Oriented concept where a subclass overrides a parent class's method(s) so it can provide it's own implementation.


In java why method defined in super class need not to defined in subclass?

In Java, or in any object oriented language such as C++, a method defined in super (parent) class does not need to be defined in a subclass, because that is the primary purpose of inheritance. Object oriented programming allows you to define and declare a class that implements the behavior for an object. Inheritance allows you to refine, or subclass, that class by "reusing" all of the functionality of the parent class into the sub class, adding additional definition and declaration for the sub class. If the subclass needs to change a parent class method, it can overload that method. This is called abstraction.


What is the use of the instanceof keyword in Java?

That is used to verify whether an object is based on the specified class (or a subclass).


What is the difference between a specialization hierarchies and specialization lattices?

Specialization Hierarchy - has the constraint that every subclass participates asa subclass in only one class/subclass relationship, i.e. that each subclass hasonly one parent. This results in a tree structure.Specialization Lattice - has the constraint that a subclass can be a subclass of morethan one class/subclass relationship.


What is the phylum of subclass prototheria?

Prototheria are in the phylum subclass chordata.


Is rosidae a subclass or it is roids a subclass?

Rosidae is a subclass of the class Magnoliatae. They are a group of trees and herbs and shrubs, mostly with flowers that are polypetalous.


The Java keyword is used to declare a class as a subclass of another class?

class MyClass extends AnotherClass {}


Why we can't create object for Container class using new keyword?

It is an abstract class so you can't instantiate it directly, but have to use a subclass instead.