A constructor creates an Object of the class that it is in by initializing all the instance variables and creating a place in memory to hold the Object. It is always used with the keyword new and then the Class name. For instance, new:Constructor in java::Constuctor is a definition block used to create the initial state of an object with the desired value.
Category:Core Java Interview Questions
No comments:
Post a Comment