When the Constructor taking no argument, is known as 0-arg constructor.
Example;
package java8s;

class A
{
      int x,y;
      A()
      {
            x=50;
            y=100;
      }
      void show()
      {
            System.out.println("x="+x);
            System.out.println("y="+y);
      }
}
class Example1 {

      public static void main(String[] args) {
            A obj=new A();
            obj.show();
           

      }

}


o-arg-constructor

Our Services:

Java Training | Python Training | Machine Learning with Python Training | Deep Learning with Python Training | Projects

SILAN Technology
Call to: 9439202111  |  9658317757  |  0674-2361252

Comment