answersLogoWhite

0

concept of overriding is very important as due to overriding the derived class can use the function of the base class!

when the function has same name and prototype in both the classes(base and derived) then the derived class can use the funtion of base class!

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

When do you declare a method or class abstract in java?

when overriding of a class or a method is necessary, they can be declared as abstract


It is an error to have a method with the same signature in both the super class and its subclass. True or false?

False. A method with the same signature in both the superclass and its subclass is known as method overriding, and is a valid concept in Java.


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.


Is overriding a dynamic polymorphism in c plus plus or not?

In C++, overriding and function, method, or operator is a different thing than (dynamic) polymorphism, so overriding a polymorphic method is almost entirely possible.


Is it possible to implement method overriding in each and every type of inheritance?

Yes. Method Overriding is not possible without inheritance and it can be done in all possible types of inheritance.


How is hiding method different from overriding method in c sharp?

Hiding means a class cannot see the definition. Overriding implies that a class must see that to "override"


How you compare and contrast overloading and overriding methods in java?

Method overloading is when you have multiple methods in a class that have the same name but a different signature. Method overriding is similar to method overloading, with a small difference. In overriding, a method in a parent class is overridden in the child class. The method in the child class will have the same signature as that of the parent class. Since the method in the child class has the same signature & name as the method of its parent class, it is termed as overriding. In situations where you may have to explicitly call the parent class method you can use the "super" keyword and for explicitly calling the current objects method you can use the "this" keyword.


What is method overriding and overloading in java?

Overloading is the means by which we can provide two or more different definitions of the same method in the same namespace. Overriding is the means by which a derived class may redefine the meaning of a base class method.


Is it possible to do method overloading and overriding at a time?

no we cannot do both at the same time because overloading requires different arguments and overriding dosenot


What is overriding in c?

Overriding relates to derived classes, where the derived class provides a new implementation for a method declared in the base class. The override is said to be a more-specialised implementation of the base class method, which is itself described as being a generic method. However, the derived class method can still call the base class method, if required.When the designer of a class can predict that their class will be derived from, they will normally provide virtual methods. These methods are expected to be overridden by the derived class. Overriding a non-virtual method can have side effects if the method is also overloaded. Overriding just one overloaded method will effectively hide all the other overloads in the base class, which may be undesirable.


What is the purpose of method overriding?

Assuming class A has a method named getXXX() and class B is a sub class of class A. Now, if we write a method with the same name getXXX() in class B, with exactly the same signature as class A, it is called overriding a method. The method getXXX() in class A becomes the overridden method.


Is overriding a preposition?

No, overriding is not a preposition. It is a term often used in computer programming to refer to the action of replacing or modifying a method or function in a superclass with a new implementation in a subclass.