answersLogoWhite

0


Best Answer

Superclasses are considered fragile because seemingly safe modifications to a super class, when inherited by the derived classes, may cause the derived classes to malfunction.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why are Inheritance super classes fragile?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is inheritance how does it help us create new classes?

Inheritance is the java feature by which the functionality of a parent class is inherited by the child class. Inheritance does not help create new classes instead it avoids creation of duplicate classes. We can re-use classes using Inheritance.


What is simple inheritance?

In object-oriented programming (OOP), inheritance is a way to reuse code of existing objects, or to establish a subtype from an existing object, or both, depending upon programming language support.In classical inheritance where objects are defined by classes, classes can inherit attributes and behavior from pre-existing classes called base classes, superclasses, parent classes or ancestor classes. The resulting classes are known as derived classes, subclasses or child classes.The relationships of classes through inheritance gives rise to a hierarchy. In prototype-based programming, objects can be defined directly from other objects without the need to define any classes, in which case this feature is called differential inheritance.The inheritance concept was invented in 1968 for Simula.


What is super class construter?

A superclass constructor is the constructor of the superclass. Constructor is a special method that runs automatically as soon as a method is instantiated (created). Superclass is the class on which a certain class is based. This is what is known as "inheritance" - classes can be based on other classes. This is done as a way of organizing classes, and for code reuse - that is, reducing the amount of duplicate code.


Advantages of multiple inheritance in UML?

dvantages of multiple inheritances:· Multiple inheritance allows a class to inherit the functionality of more than one base class thus allowing for modeling of complex relationships· You categorize classes in many ways. Multiple inheritance is a way of showing our natural tendency to organize the world. During analysis, for example, we use multiple inheritance to capture the way users classify objects.· By having multiple super-classes, your subclass has more opportunities to reuse the inherited attributes and operations of the super-classes.Disadvantages of multiple inheritances:· Some programming languages (such as Java) do not allow you to use multiple inheritances. You must translate multiple inheritance into single inheritance or individual java interfaces. This can be confusing and difficult to maintain because the implemented code for categorizing objects is quite different fro the way the user organizes those objects. So, when the user changes their mind or adds another category, it is difficult to figure out how to program the new sub classes.· The more super classes your sub class inherits from the more maintenance you are likely to perform. If one of the super classes happens to change, the sub class may have to change as well.· When a single sub class inherits the same attribute or operation form different super classes, you must choose exactly which one it must use.Multiple inheritances can cause a lot of confusion, say when both the classes from which you want the child class to inherit from, has a method with sameMuhammad ShahbazLinux AdministratorOther Responses:The Eiffel language and method was designed from the ground up to have multiple inheritance without ANY of the `gotchas' of languages like Java, C++ and others. The `disadvantages' listed above have nothing to do with MI, but with the technique and technologies listed (e.g. Java or C++). When MI is designed thoughtfully into a language and method, then the `dangers' or `disadvantages' are not there. As an Eiffel engineer, we use MI extensively, safely and beneficially all the time.


How do you implement inheritance in c plus plus?

You implement inheritance by deriving a new class of object from an existing class of object. The existing class is known as the base class of the derived class.Classes declared final cannot be used as bases classes and classes without a virtual destructor (or a virtual destructor override) cannot be used as polymorphic base classes.

Related questions

What is inheritance how does it help us create new classes?

Inheritance is the java feature by which the functionality of a parent class is inherited by the child class. Inheritance does not help create new classes instead it avoids creation of duplicate classes. We can re-use classes using Inheritance.


What do you mean by object?

In advanced programming languages, the re-usability of a portion of code capable of performing a given function is an unique advantage. The compartmentalization of a code which can be reused later and invoked by the class name is referred as object inheritance. In classical inheritance classes are used while in object inheritance sub classes and super classes are add-on features. It saves lengthy redundant coding by inherting the desired code function and calling it by name . -JP Morgan


Why object is the super class in java?

The answer to this is related to the idea of inheritance in general - the idea of inheritance is that you define a common set of behaviors, that apply to all subclasses. Anything defined in the "Object" class is available to all classes you create. Look in the documentation for the description of the "Object" class, to see what methods are available in all Java classes.


What is simple inheritance?

In object-oriented programming (OOP), inheritance is a way to reuse code of existing objects, or to establish a subtype from an existing object, or both, depending upon programming language support.In classical inheritance where objects are defined by classes, classes can inherit attributes and behavior from pre-existing classes called base classes, superclasses, parent classes or ancestor classes. The resulting classes are known as derived classes, subclasses or child classes.The relationships of classes through inheritance gives rise to a hierarchy. In prototype-based programming, objects can be defined directly from other objects without the need to define any classes, in which case this feature is called differential inheritance.The inheritance concept was invented in 1968 for Simula.


What is hierarchal inheritance?

Hierarchical inheritance is a type of inheritance in object-oriented programming where classes are organized in a hierarchical structure. It means that a derived class can inherit attributes and methods from a base or parent class, and it can further be inherited by other classes. This allows for code reuse and promotes modularity in the program.


Specialization form of inheritance?

Inheritance refers to the concept by which the features from one class can be extended/made available in other classes. Java supports 3 forms of inheritance * Single Inheritance * Multiple Inheritance * Multilevel Inheritance (Can be implemented using interfaces)


Is it possible to implement overriding in every inheritance?

Yes. It is possible to implement overriding in every inheritance level. If there are methods of the same name in multiple classes in the hierarchy the one that is closest to the current object gets invoked. The other methods can be specifically invoked using the super keyword.


Can you use multiplicity on inheritance for example an accommodation super-class has 3 derived classes say guesthouse cottage and hut but each of these have a minimum and maximum guest amount?

The multiplicity on inheritance (a kind of relationship between classes) is a constraint on the number of the classes on each end of the INHERITANCE relationship: ClassA -*--------*- ClassB the general relationship between classesThe INHERITANCEClassBase


What kind of inheritance is not allowed in java?

Java does not allow the multiple inheritance of concrete classes, though it does allow a "hybrid" inheritance of one concrete class and multiple interfaces.


Why multiple inheritance needed in object oriented technology?

to access the data from one or more classes to the sub classes


Examples for oops concepts?

polymorphism,inheritance,encapsulation,objects,classes


What is super class construter?

A superclass constructor is the constructor of the superclass. Constructor is a special method that runs automatically as soon as a method is instantiated (created). Superclass is the class on which a certain class is based. This is what is known as "inheritance" - classes can be based on other classes. This is done as a way of organizing classes, and for code reuse - that is, reducing the amount of duplicate code.