Computer Applications
Which of the following is NOT true for polymorphism?
- All methods have the same name.
- Methods are invoked based on the arguments.
- Methods should have the same number and the same type of arguments.
- It is a principle of OOPs.
OOP Intro Java
1 Like
Answer
Methods should have the same number and the same type of arguments.
Reason — Polymorphism allows methods with the same name to behave differently based on the number or type of arguments passed. Hence, methods do not need to have the same number and same type of arguments.
Answered By
2 Likes
Related Questions
Which of the following String methods has integer argument?
(i) length
(ii) substring
(iii) indexOf
(iv) charAt- Only (ii)
- (i) and (iv)
- (ii) and (iv)
- (iii) and (iii)
Assertion: Property by virtue of which one class acquires the properties of another class is termed as Inheritance.
Reason: Inheritance promotes reusability.
- Assertion is true, Reason is false.
- Assertion is true, Reason is true.
- Assertion is false, Reason is false.
- Assertion is false, Reason is true.
Which of the following is a valid initialisation statement?
- int x = "GOOD";
- int y = 45.0/2;
- int z = (int)'x';
- int m = false ;
Which of the following is a valid statement to print the following sentence:
Raj said "Good morning"
- System.out.println("Raj said "Good morning");
- System.out.println("Raj said \\Good morning\\);
- System.out.println("Raj said \"Good morning\" ");
- System.out.println("Raj said Good morning");