use of return
Prograam
class Sample
{
int i,j;
Sample()
{
i=0;
j=0;
}
Sample(int a,int b)
{
i=a;
j=b;
}
String toString()
{
return "i="+i+" "+"j="+j;
}
}
class SampleDemo
{
public static void main(String args[ ])
{
Sample ob=new Sample(45,56);
System.out.println(ob);
}
}
Output:
i=45 j=56
Comments
Post a Comment