Computer Science, asked by Ismail54, 1 year ago

What is constructor in java ?

Answers

Answered by AJAYMAHICH
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 sghfjh
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