Introduction
Software Requirement
Simple program
- class overlo {
- double x, y;
- overlo(double a, double b) {
- x = a;
- y = b;
- }
- public void squ() {
- System.out.println("The Area of Square : " + (x * x));
- }
- public void rec() {
- System.out.println("The Area of Rectangle : " + (x * y));
- }
- public void cir() {
- System.out.println("The Area of Circle : " + (3.14 * x * x));
- }
- public static void main(String arg[]) {
- overlo t;
- t = new overlo(4, 4);
- t.squ();
- t = new overlo(5, 6);
- t.rec();
- t = new overlo(2, 3);
- t.cir();
- }
- }
Output

Join the conversation! Your thoughts help the community grow.