What is the difference between a constructor and a method in Java?
A. A constructor has a return type, while a method does not.
B. A constructor can be called explicitly, while a method is called implicitly.
C. A constructor has the same name as the class, while a method can have any name.
D. None of the above
Answer:C
What is the difference between a constructor and a method in Java?
A. A constructor has a return type, while a method does not. B. A constructor can be called explicitly, while a method is called implicitly. C. A constructor has the same name as the class, while a method can have any name. D. None of the above