What is a constructor in Java?
A. A method that is used to destroy an object.
B. A method that is used to create an object.
C. A variable that is used to store the state of an object.
D. A variable that is used to store the behavior of an object.
Answer:B
What is a constructor in Java?
A. A method that is used to destroy an object. B. A method that is used to create an object. C. A variable that is used to store the state of an object. D. A variable that is used to store the behavior of an object.