I need help i cnat purchase pro with my card, it just says please contact pro@codecademy.com


<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

``` I don't understand what this is doing in the script

public class YourName {
public static void main(String args) {

<do not remove the three backticks above>

This is just declaring the class, which you have to do for every java document you do. This is just a basic implementation of it. If you know HTML, think of it as the <!DOCTYPE html> part of every html doc you make.

As for the second line, I wasn’t sure how to explain it so I googled it. I found this on a stackoverflow forum.

It means that you can call this method from outside of the class you are currently in. This is necessary because this method is being called by the Java runtime system which is not located in your current class.

When the JVM makes call to the main method there is no object existing for the class being called therefore it has to have static method to allow invocation from class.

Java is platform independent language and if it will return some value then the value may mean different things to different platforms. Also there are other ways to exit the program on a multithreaded system.

It’s just the name of method. This name is fixed and as it’s called by the JVM as entry point for an application.

String args:
These are the arguments of type String that your Java application accepts when you run it.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.