❮ Previous Next ❯

0-arg Constructor:

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

❮ Previous Next ❯


  Tutorials

Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Bhubaneswar-751013
      Email: info@silantechnology.com
      Phone: 0674-2361252
address
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved