public class Test { }
What is the prototype of the default constructor?
A.public Test(void)
B.Test( )
C.Test(void)
D.public Test( )
Answers
Answered by
4
public test (void) is your answer guy
Answered by
0
Option(d) is the correct answer to the given question.
Explanation:
- Constructor are used to initialize the object of the class .There are following properties of constructor that is given below.
- The constructor name should match with the class name.
- Their is no return type of constructor not even void;
- We do not used the return keyword in constructor .
- In the option(A) and option(C) the void return type is used that's why it is incorrect option.
- In option(b) the public keyword is not used that;s why it is incorrect for the default constructor .
Therefore Option(d) is the correct answer .
Learn More :
- brainly.in/question/5798383
Similar questions
English,
7 months ago
Hindi,
7 months ago
Hindi,
7 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
English,
1 year ago
Math,
1 year ago