Simple JAVA code help
I am new to this, and have wrote the code, but keep getting the same error and completely clueless on what to do next. Any help would be greatly appreciated.
import java.util.*;
public class A1RE5161843 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter length of rectangle :");
double length = input.nextDouble();
System.out.print("Enter width of rectangle :");
double width = input.nextDouble();
System.out.println("Area: "+(length * width));
System.out.println("Perimeter: "+((2*length)+(2*width)));
}
}
Main.java:12: class A1RE5161843 is public, should be declared in a file named A1RE5161843.java
public class A1RE5161843 {
^
1 error
|