Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: With out main class run a program

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow With out main class run a program

    can u any one tell me that, with out a main class can u run the code ....in java


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: With out main class run a program

    Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.

    It's not a simple yes/no answer. The main() method is the entry point for a Java application. However, a Java applet does not require a main() method, and classes that support an application but do not stand on their own as applications need not have a main() method.

    There is at least one instructional IDE that allows the running of classes meant to be the entry point of an application without a main() method. I don't understand why, but it's someone's idea of a good way to learn the language even though it's contrary to how Java works in the real world.

Similar Threads

  1. "Could not find the main class: main. program will exit" - Wierd case.
    By AvivC in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 25th, 2014, 07:44 PM
  2. Replies: 2
    Last Post: November 18th, 2012, 02:09 PM
  3. create a test class (main method) to start(run) the class in Java
    By curious725 in forum Java Theory & Questions
    Replies: 5
    Last Post: August 1st, 2012, 03:21 AM
  4. Main method/ class problem. I can't run any script!
    By BokBok in forum What's Wrong With My Code?
    Replies: 3
    Last Post: June 28th, 2012, 05:14 PM
  5. Replies: 6
    Last Post: July 21st, 2011, 07:45 AM