help writing methods in java:?

Patrick

New member
I have to write a method called cube that accpets on integer parameter and returns that value raised to the third power.

would this be correct?

public static void cube(){
int num;
public int getnum(){
return num;
}
public void setnum(int num){
this.num = math.pow(num,3)
}
 
Back
Top