Professional Documents
Culture Documents
Classes Object Program
Classes Object Program
class Box
{
double l,w,h;
}
System.out.println("BOX b1 Details:");
System.out.println("Height" + b1.h);
System.out.println("Width" + b1.w);
System.out.println("Length" + b1.l);
System.out.println("BOX b2 Details");
System.out.println("Height" + b2.h);
System.out.println("Width" + b2.w);
System.out.println("Length" + b2.l);
}
}
Output:
BOX b1 Details:
Height 20.0
Width 10.0
Length 30.0
BOX b2 Details
Height 30.0
Width 40.0
Length 50.0