class A
{
int a; double b; String c;
A()
{
a= 10; b= 0.098; c= "hii";
}
A(int x)
{
a=x;
}
A( double y, String z)
{
b=y; c=z;
}
}
class Z
{
public static void main(String[] args)
{
A r = new A();
A r2= new A(10);
A r3= new A(0.99," ok");
System.out.println(r.a+" "+r.b+" "+r.c);
System.out.println(r2.a);
System.out.println(r3.b+" "+r3.c);
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter