Computer Science, asked by kshantanu2004, 1 year ago

please correct the following code in JAVA.

public class P_6_8
{
double calc_volume(int r)
{
double vol=(4/3)*(22/7)*r*r*r;
System.out.println("The volume is: "+vol);
}
double calc_volume(int h,int r)
{
double vol=(4/3)*r*r*h;
System.out.println("The volume is: "+vol);
}
double calc_volume(int r)
{
double vol=(1/3)*(22/7)*r;
System.out.println("The volume is: "+vol);
}
public static void main(String args[])
{
P_6_8 ob=new P_6_8();
ob.calc_volume();
}
}

Answers

Answered by avinashmurmu99311
1

Explanation:

all are pure function with no return type

Similar questions