I did this java program, i just want someone to correct it.

In this exercise, you will be writing a simple java program to explore using multi methods. The program is consists of one class (MultiMethods). It will hold more than one methods. The purpose of the program is to calculate and display the volume, area, and perimeter of a cube. The length of the cube will be collected from the keypad. For each calculation, you must have a corresponding method. As such, your program will have 4 methods including the main() method.

my java program is
public static void main(String[] args) {
Scanner in= new Scanner(System.in);
System.out.println("Enter the length: ");
int side = in.nextInt();
multimethods Methods = new multimethods(side);

System.out.println("Area = " + Methods.getArea());
System.out.println("Perimeter = " + Methods.getPerimeter());
System.out.println("Volume = " + Methods.getvolume());
}

public static class multimethods {
private final int side;

multimethods(int side) {
this.side = side;
}
double getArea() {
return 6 * (side * side);
}
double getPerimeter() {
return 4 * (side);
}
double getvolume(){
return side * side * side;
}
}

3 answers

looks basically ok.
I think your class declaration is messed up though.
Did you actually run it?

google is your friend. You can use it to find many code snippets online, doing practically anything you can want. And don't forget the excellent java documentation.
yes i did run it and it works normal
well, then, I guess you're ok, right?
Similar Questions
    1. answers icon 4 answers
  1. 1. What is Java SE?A. Java Standard Edition* B. Java Software Editor C. Java Scientific Edition D. Java Software Emulator 2.
    1. answers icon 1 answer
  2. PLZ HELP ASAP1. What is Java SE? A. Java Standard Edition B. Java Software Editor C. Java Scientific Edition D. Java Software
    1. answers icon 2 answers
  3. JAVA PROGRAM Details:I'm having a trouble with the print lines, i'm not sure where to start but i think I got the rest down
    1. answers icon 0 answers
more similar questions