Computer Science, asked by Tanmaychavda7577, 1 year ago

If the sub class overrides the method in the parent class, the overridden method can be invoked by using either this or super keyword. State true or false.

Answers

Answered by harshkandpal
0

Explanation:

An instance method in a subclass with the same signature (name, plus the number and the type of its parameters) and return type as an instance method in the superclass overrides the superclass's method.

The ability of a subclass to override a method allows a class to inherit from a superclass whose behavior is "close enough" and then to modify behavior as needed. The overriding method has the same name, number and type of parameters, and return type as the method that it overrides. An overriding method can also return a subtype of the type returned by the overridden method. This subtype is called a covariant return type.


harshkandpal: plz mark me as brainliest
Answered by gratefuljarette
2

If the subclass overrides the method in the parent class, the overridden method can be invoked by using either this or super keyword is a true statement.

Explanation:

  • In achieving Run Time Polymorphism, the overriding method is applied by JAVA. The object that helps in invoking the method will determine the version of the overriding method.
  • The use of parent class object in invoking the method will execute the version in the same class and the subclass will be executed in the child class. The overridden method that invokes from the subclass to the parent class is done by the use of the method of the super keyword.

Learn more about Run Time Polymorphism

Do we need public inheritance for run time polymorphism in C++ ?

https://brainly.in/question/4164364

Difference between runtime polymorphism and compile time polymorphism

https://brainly.in/question/4107544

Similar questions