About 406,000 results
Open links in new tab
  1. java - How does the main method work? - Stack Overflow

    Apr 12, 2013 · In C or C++, the main method can return an int and usually this indicates the code status of the finished program. An int value of 0 is the standard for a successful completion. To …

  2. java - "Error: Main method not found in class MyClass, please …

    In Java's case, this is the static method main, which is passed the parameter args[] containing the command line arguments. This method is equivalent to int main(int argc, char** argv) in C …

  3. Why is the Java main method static? - Stack Overflow

    Sep 29, 2008 · The main method is static to give the Java VM interpreter a way to start the class without creating an instance of the control class first. Instances of the control class are created …

  4. java - Could not find or load main class - VS Code - Stack Overflow

    Sep 9, 2019 · I don't know if this will help anybody, but I had this problem because my class with the main method didn't have the .java file extension. Renaming the file allowed the compiler to …

  5. Why main() method is needed in java main class - Stack Overflow

    Sep 16, 2011 · The main method in the Java language is similar to the main function in C and C++. When the Java interpreter executes an application (by being invoked upon the …

  6. Can we overload the main method in Java? - Stack Overflow

    Sep 21, 2010 · Yes, you can overload main method in Java. But the program doesn't execute the overloaded main method when you run your program, you have to call the overloaded main …

  7. java - What is the "String [] args" parameter in the main method ...

    May 21, 2009 · That String[] args part may become optional in future versions of Java. Work is underway to allow for simplified declaration of main method. See JEP 463: Implicitly Declared …

  8. java - Why doesn't the main method run? - Stack Overflow

    Jul 2, 2015 · A bit confused about the public static void main method in Java and was hoping someone could help. I have two classes public class theGame { public static void main (String …

  9. Who calls the main function in java? - Stack Overflow

    The Java runtime searches for the startup class, and other classes used, in three sets of locations: the bootstrap class path, the installed extensions, and the user class path. Non …

  10. calling another method from the main method in java

    Jan 31, 2011 · First java will not allow you to have do() method. Instead you can make it doOperation(). Second You cann't invoke directly non static methods from static function. Main …