//File name --> Rectangle.java
class Rectangle
{
public static void main(String args[])
{
int width=15,height=10;
int area=width*height;
System.out.println("Area of Rectangle having width "+width+" and height "+height+" is:"+area);
}
}
OUTPUT
javac Rectangle.java
java Rectangle
Area of Rectangle having width 15 and height 10 is:150
class Rectangle
{
public static void main(String args[])
{
int width=15,height=10;
int area=width*height;
System.out.println("Area of Rectangle having width "+width+" and height "+height+" is:"+area);
}
}
OUTPUT
javac Rectangle.java
java Rectangle
Area of Rectangle having width 15 and height 10 is:150