I'm working on two basic programs, I'm just learning java and getting some errors I don't understand.
The first program uses the "double" for variables in order to print decimals. I know I'm not using it right but this is what I have:
Code:
public class Prog4 {
public static main(String[]) {
double calc;
//Formula
calc = (((9.5*4.5)-(2.5*3))/(45.5-3.5));
//Print results
System.out.println(calc);
}
}
and this is the error I get:
Code:
Prog4.java:2: invalid method declaration; return type required
public static main(String[]) {
^
Prog4.java:2: <identifier> expected
public static main(String[]) {
I know terrible.

The other program I know is written correctly I have others like it, it just prints out some text. But I get this error after successfully compiling and trying to run.
Code:
Exception in thread "main" java.lang.NoSuchMethodError: main
I think it's worth mentioning I'm doing this in the VI editor.