1

I am really fresh at Java.

I'have created new Java Project. Created package Main and Main.java class Main in this package.

package Main;

public class Main {
     public Main(String[] argv) {
          System.out.println("Helloworld.");
     }
}

When I try to run it - Eclipse gives an error: Selection does not contain applet.

1 Answer 1

3

Don't create/run-as applet.

Some other notes:

1) main methods must be declared as follows in order to be recognized as an entry point:

public static void main(String[] argv) {
    // Your code here
}

The name of the parameter is arbitrary, but usually argv or args.

2) Packages should be named in all-lower case. Method names should start with a lower-case letter.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.