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
Math,
9 months ago
Social Sciences,
9 months ago
Physics,
9 months ago
Science,
1 year ago
Social Sciences,
1 year ago
Sociology,
1 year ago
Physics,
1 year ago