What is the difference between a constructor and a method in Java?
A. A constructor is used to initialize an object, while a method is used to perform a specific action on an object.
B. A constructor is used to perform a specific action on an object, while a method is used to initialize an object.
C. A constructor is a special method, while a method is a regular method.
D. A constructor is used to create an object, while a method is used to destroy an object.
Answer:A
What is the difference between a constructor and a method in Java?
A. A constructor is used to initialize an object, while a method is used to perform a specific action on an object. B. A constructor is used to perform a specific action on an object, while a method is used to initialize an object. C. A constructor is a special method, while a method is a regular method. D. A constructor is used to create an object, while a method is used to destroy an object.