Sponsered Links
Categories
Sponsered Links

Write a program USING CONCEPT OF FUNCTION OVERLOADING FOR THE FUNCTION NAME AREA(). IN 1 FUNCTION FIND THE SURFACE AREA OF CUBE AFTER PASSING ITS ONE SIDE TO THE FUNCTION. IN THE 2 FIND THE SURFACE AREA OF CUBE AFTER PASSING ITS L, B & H TO THE FUNCTION ARRAYS.

Write a program USING CONCEPT OF FUNCTION OVERLOADING FOR THE FUNCTION NAME AREA(). IN 1 FUNCTION FIND THE SURFACE AREA OF CUBE AFTER PASSING ITS ONE SIDE TO THE FUNCTION. IN THE 2 FIND THE SURFACE AREA OF CUBE AFTER PASSING ITS L, B & H TO THE FUNCTION ARRAYS.

class TWELVE{
    public int AREA(int side){
        return(6*side*side);
    }
    public int AREA( int L, int B,int H){
        return 2*(L*B+B*H+H*L);
    }
    public static void main( String arr[] ){
        TWELVE temp = new TWELVE();
        System.out.println("Surface Area of Cube: "+temp.AREA(4));
        System.out.println("Surface Area of Cuboid: "+temp.AREA(2,3,4));
    }
}

Sponsered Links
Latest Updates
 
All Content of this site is for learning only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright © 2009 JSPSERVLETTUTORIAL.INFO All Right Reserved