i

JAVA Complete Course

JAVA Class Fundamentals

In Java everything is related to classes. Classes contain attributes and methods. Attributes are properties, and methods are actual functionality inside the class. Also class has constructors. If we don’t define explicitly, every class will have no arguments constructor by default. But if we define only one constructor in our class with arguments, then we won’t be able to create an object of our class with no-argument constructor. We can have multiple constructors in our class.

Now let’s see the example how to create different objects with different constructors.