Java constructors vs. methods: differences
Hello everyone
I’m learning Java right now, and I’m interested in the distinctions between constructors and methods. I’ve read a little about it online, but I’m still unsure if I really get the differences.
Can someone provide me with a quick summary of the differences between Java constructors and methods?
Add comment
Answers (1)
Add AnswerHere is a quick summary of how Java constructors and methods differ from one another:
Constructors: Special procedures called constructors are used to initialize objects. When an object is created, they are called.
Methods: Methods are used to perform actions on objects. They can be called at any time during the execution of a program.
For more detailed answers refer to Java interview questions and answers.