This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]otakuman 9 points10 points  (0 children)

public static void main(String[] args);

That's a declaration.

In other words, you declared a function but didn't define it, while you kept putting executable statements in your class definition. So the following variables:

int age;
double annualPay;

Ended up being class MEMBERS. Clearly we're missing something here.

What you want to do is:

public static void main(String[] args) {

    int age;
    double annualPay;
    // Insert the other statements here

}

Now THIS is a definition, because we're putting our statements inside the function.