What is the primary purpose of a constructor in Java?

Last Updated :
Discuss
Comments

What is the primary purpose of a constructor in Java?

To allocate memory

To initialize an object

To call methods


To delete objects

Share your thoughts in the comments