follow

Saturday, 6 July 2013

CONSTRUCTOR : JAVA Programming by "Gopal Krishna"

class xyz 
{
int a,b,i;
xyz()
{
System.out.println("the value of a ->"+a);
System.out.println("the value of a ->"+b);
}
xyz(int a,int b)
{
int c=0;
c=a+b;
System.out.println("the value of a ->"+c);
}
xyz(int i)
{
i=i+1;
System.out.println("the value of a ->"+i);
}
}

class test
{
public static void main(String arg[])
{
xyz x1=new xyz();
xyz x2=new xyz(6,9);
xyz x3=new xyz(1);
}
}

No comments:

Post a Comment