What is a constructor in Java?
A. A method that returns a value.
B. A method that is used to create objects.
C. A method that is called on a class itself.
D. A method that is used to modify objects.
Answer:B
What is a constructor in Java?
A. A method that returns a value. B. A method that is used to create objects. C. A method that is called on a class itself. D. A method that is used to modify objects.