What are constructors in Java?

Total Post:83

Points:415

Java 
 489  View(s)
Ratings:
Rate this:
  1. What are constructors in Java?

    In Java, constructor refers to a block of code similar to a method that’s called when an instance of an object is created. A constructor in Java must have the same name as that of the class. And it’s called automatically when a new instance of an object is created. Constructors are not considered as members of a class.

Answer