What is constructor in java ?
Answers
Answered by
2
A constructor in Java is a block of code similar to a method that’s called when an instance of an object is created.
Answered by
3
A constructor in Java is a block of code similar to a method that's called when an instance of an object is created. Here are the key differences between a constructor and a method: A constructor doesn't have a return type. ... Unlike methods, constructors are not considered members of a class.
Similar questions