Start learning 50% faster. Sign in now
Runtime polymorphism (or dynamic method dispatch) occurs when a method's implementation is determined at runtime. This is achieved using method overriding in OOP. A derived class overrides a method of the base class, and the method to execute is determined by the type of the object being referenced at runtime. Example: class Animal {   void sound() {     System.out.println("Animal makes a sound");   }} class Dog extends Animal {   void sound() {     System.out.println("Dog barks");   }} public class Main {   public static void main(String[] args) {     Animal animal = new Dog(); // Base class reference pointing to a derived class object     animal.sound();      // Outputs: Dog barks   }} Why Other Options Are Incorrect: 1. Method with the same name but different parameters within the same class: This is compile-time polymorphism (method overloading), not runtime polymorphism. 2. Default arguments in methods: Default arguments provide flexibility but are unrelated to polymorphism. They simplify method calls without changing the behavior based on the object’s runtime type. 3. Static methods for shared functionality: Static methods are class-level and cannot participate in runtime polymorphism, as they are resolved at compile time. 4. Constructor with a parameter list in the derived class: Constructors are not polymorphic as they do not inherit or override behavior in OOP.
Select the option that is related to the third term in the same way as the second term is related to the first term.
DFB : GHC :: LNJ : ?
Four letter-clusters have been given out of which three are alike in some manner and one is different. Select the letter-cluster that is different.Â
Select the correct option that indicates the arrangement of the given words in the order in which they appear in an English dictionary.
1. Grasp<...
‘A # B’ means ‘A is the brother of B’.
‘A @ B’ means ‘A is the daughter of B’.
‘A & B’ means ‘A is the husband of Bâ...
The position of how many alphabets will remain unchanged if each of the alphabets in the word ‘MANGROVE’ is arranged in alphabetical order from left...
Arrange the following in the English alphabetical order:
(i) Exploration
(ii) Exploitative
(iii) Exploratory
(iv) ExploitationÂ
WATER : RVOZM :: BOTTLE : ?
Select the correct combination of mathematical signs that can sequentially replace the '$' signs and balance the equation.
180 $ 9 $ 6 ...
How many pairs of letters are there in the word ‘FARMHOUSE’ each of which have as many letters between them (both forward and backward direction) in...
In a certain code language, SAFETY is written as 21 – 3 – 8 – 7 – 22 – 27. How will FRIEND be written in that code language?
...