Constructor in Java

Constructor is a special method which does not have any return type. It is mainly used to initialize an object, means providing values for the data members of an object. Since its constructing an object by initializing its data members, It’s called Constructor. Every class should have at least one constructor. If we don’t add […]

Share this article on
< Previous