What is a constructor in Java?
A. A method that is used to create a new object of a class.
B. A method that is used to destroy an object of a class.
C. A method that is used to access a private variable.
D. None of the above.
Answer:A
What is a constructor in Java?
A. A method that is used to create a new object of a class. B. A method that is used to destroy an object of a class. C. A method that is used to access a private variable. D. None of the above.