OOPS

August 29, 2024

OOPS

August 29, 2024

OOPS

August 29, 2024

OOPS

August 29, 2024

OOPS

Question 174
Constructors have _____ return type.
A
void
B
char
C
int
D
no
Question 174 Explanation: 
Syntax For Constructors:
Access_Modifier No Return_Type Class(…)
Example:
public static main(String [ ]args)

Constructor rules:
1. Constructors are always used with a new.
2. Have same name as that of Class
3. Does not have a return type
4. Can be Overloaded but not Overridden.

Correct Answer: D
Question 174 Explanation: 
Syntax For Constructors:
Access_Modifier No Return_Type Class(…)
Example:
public static main(String [ ]args)

Constructor rules:
1. Constructors are always used with a new.
2. Have same name as that of Class
3. Does not have a return type
4. Can be Overloaded but not Overridden.

Leave a Reply

Your email address will not be published. Required fields are marked *