# calculate volume of cube, cylinder and rectangular box using method overloading in java

Amit
calculate volume of cube, cylinder and rectangular box using method overloading in java
3 Answer(s)      6 years and 8 months ago
Posted in : Java Beginners

calculate volume of cube, cylinder and rectangular box using method overloading in java

March 24, 2011 at 11:46 AM

calculate volume of cube, cylinder and rectangular box using method overloading in java

March 24, 2011 at 1:44 PM

```class Overload {
double area(float l, float w, float h) {
return l * w * h;
}

double area(float l) {
return l * l * l;
}

double area(float r, float h) {
return 3.1416 * r * r * h;
}
}
public static void main(String args[]) {
double rectangleBox = overload.area(5, 8, 9);
System.out.println("Area of ractangular box is " + rectangleBox);
System.out.println("");
System.out.println("Area of cube is " + cube);
System.out.println("");
System.out.println("Area of cylinder is " + cylinder);
}
}
```

It's output is :

```Area of ractangular box is 360.0

Area of cube is 125.0

Area of cylinder is 1357.1712
```

March 24, 2011 at 3:02 PM

thank you,,,,,:)

calculate volume of cube, cylinder and rectangular box using method overloading in java
calculate volume of cube, cylinder and rectangular box using method overloading in java  calculate volume of cube, cylinder and rectangular box using method overloading in java   calculate volume of cube, cylinder
write a program to calculate volume of a cube, cylinder, rectangular box using method overloading
write a program to calculate volume of a cube  write a program to calculate volume of a cube, cylinder, rectangular box using method overloading..., 8, 9); System.out.println("Volume of rectangular box
find the volume of the box - Java Interview Questions
and a method to find the volume of the box and also write the main program, which creates the box object, and find the volume of the box. Print the result...find the volume of the box  Write a class Box with the variable width
method overriding in java
method overriding in java  program to compute area of square,rectangle,triangle,circle and volume of sphere,cylinder and perimeter of a cube using method overriding
method overriding in java
method overriding in java  program to compute area of square,rectangle,triangle,circle and volume of sphere,cylinder and perimeter of a cube using method overriding
method overloading   public void test(int a); pulic void test(long a);which sutiation x.long is called
java program
java program  write a java program to compute area of a circle.square,rectangle.triangle,volume of a sphere ,cylinder and perimeter of cube using method over riding
java program
java program  write a java program to compute area of a circle.square,rectangle.triangle,volume of a sphere ,cylinder and perimeter of cube using method over riding
method over riding
method over riding  write a java program to compute volume of sphere and volume of cylinder using method over riding
method overloading  public void test(int a){} public void test(long a){} i will call some x.test(125) which method is called pls tell me
method overloading  public void test(int a) public void test(long a) public void test(object a) i will call some x.test(1258448); which method is called if it is called first one why it not call the third one
method overloading  what is output of this program & why class Test { public void display(String msg) { system.out.println(msg); } public void display(Object msg) { system.out.println(msg
In this tutorial you will learn one of polymorphism concept that is method overloading with example in Java 7
Using throw in java method
Using throw in java method  using throw with method implies what
Write a Java applet to draw cylinder and pentagon shapes.
Write a Java applet to draw cylinder and pentagon shapes.  Write a Java applet to draw cylinder and pentagon shapes
how to calculate the price on the option box
how to calculate the price on the option box  How i calculate the value when i using a option box with 2 option..first option i used for product name... to calculate this value