← BYTES
Java·Starter·Ref: 9.1.8
What is the purpose of a constructor in Java?
Have a question about this video? Mention reference 9.1.8 when you contact us.
a.To initialize a newly created object's state
b.To destroy an object when it's no longer needed
c.To compile the class
d.To import other classes
A constructor runs automatically when an object is created with `new`, giving you a place to set up initial field values and any other required setup before the object is used.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES918#Java