Q&A
Ask and answer questions to make information more available to wider audiences.
Trevor Billson @billsontrevor   30, Jun 2023 12:00 AM
differences between constructor and method of a class
What are the differences between constructor and method of a class in Java?
answers 1
 
Answer 1
Noah Antills @noahantills   07, Jul 2023 02:18 PM
Initializing the state of the object is done by constructors. A function Object () { [native code] }, like methods, contains a group of statements (or instructions) that are carried out when an object is created. A method is a group of statements that work together to complete a certain task and return the outcome to the caller. A method has the option of working without returning anything.