Computer Science, asked by sowmikareddy6072, 1 year ago

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 kuldeeee73
4
public test (void) is your answer guy
Answered by StaceeLichtenstein
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