Computer Applications
Constructor overloading follows which principle of Object Oriented programming?
- Inheritance
- Polymorphism
- Abstraction
- Encapsulation
Java Constructors
ICSE Sp 2024
37 Likes
Answer
Polymorphism
Reason — In object-oriented programming, Polymorphism provides the means to perform a single action in multiple different ways and constructor overloading follows Polymorphism principle of Object Oriented programming wherein a constructor having the same name behaves differently with different arguments.
Answered By
25 Likes
Related Questions
Which of the following is the wrapper class for the data type char?
- String
- Char
- Character
- Float
Name the package that contains wrapper classes:
- java.lang
- java.util
- java.io
- java.awt
Which of the following is a valid Integer constant:
i. 4
ii. 4.0
iii. 4.3f
iv. "four"- Only i
- i and iii
- ii and iv
- i and ii
The method compareTo() returns …………… when two strings are equal and in lowercase :
- true
- 0
- 1
- false