☕️JAVA Language Community
2.91K subscribers
144 photos
7 videos
31 files
42 links
☕️ Software, IT, Java, news
💻 IT highlights
🎯 AI update
🖥⌨️🖱
Download Telegram
☕️JAVA Language Community
More details: 👉Constructor in Java Constructor in java is a special type of method that is used to initialize the object. Java constructor is invoked at the time of object creation. It constructs the values i.e. provides data for the object that is why…
#Java_Interview_Question

#Constructor

Constructor Overloading in Java

Constructor overloading is a technique in Java in which a class can have any number of constructors that differ in parameter lists.The compiler differentiates these constructors by taking into account the number of parameters in the list and their type.

@javaCode☕️
☕️JAVA Language Community
#Java_Interview_Question #Constructor Constructor Overloading in Java Constructor overloading is a technique in Java in which a class can have any number of constructors that differ in parameter lists.The compiler differentiates these constructors by taking…
#Java_Interview_Question

#Constructor

Difference between constructor and method in java

There are many differences between constructors and methods. They are given below.

▫️Constructor is used to initialize the state of an object.
▪️Method is used to expose behaviour of an object.


▫️Constructor must not have return type.
▪️Method must have return type.


▫️Constructor is invoked implicitly.
▪️Method is invoked explicitly.


▫️The java compiler provides a default constructor if you don't have any constructor.
▪️Method is not provided by compiler in any case.


▫️Constructor name must be same as the class name.
▪️Method name may or may not be same as class name.

@javaCode☕️