what is the use of constructors in java when we can intialize objects directly
Jump to Post
Can you elaborate a little more on the question? All object creation is done through constructors. If no constructor is specified, the compiler will supply a default empty constructor that basically does nothing. If you wish to provide info that initializes some values in the object when it's created, you …
All 8 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.