answersLogoWhite

0

Other than throwing an exception or a run-time library error, or forcibly terminating the process, there is only one way of exiting a program; you return from the entry point function, usually main(), provided by the library, or from winmain(), if you are using Windows.

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

The main method of a program has?

The Java main method of a program is the place where the program execution begins. A main method would look like below public static void main(String[] args){ }


If a program have 2 main methods can the program run or not?

No, a program may not work with two main methods. If we preferred with working with many packages means then each package may consist of a main method.


What must every c program have?

A main function must be present in every C program.


Can you run java program without applying main method?

yes we can run java program without using main. we can run program by declaring the variable static..


Write a program in java for creating multiple threads?

class NewThread implements Runnable { String name; Thread t; NewThread(String threadname) { name=threadname; t=new Thread(this,name); System.out.println("New Thread:"+t); t.start(); } public void run() { try { for(int i=5;i>0;i--) { System.out.println(name+ ":"+i); Thread.sleep(1000); } } catch(InterruptedException e) { System.out.println(name+" Interrupted"); } System.out.println(name+" exiting"); } } class MultiThreadDemo { public staticvoid main(String[] args) { new NewThread("One"); new NewThread("Two"); new NewThread("Three"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.out.println("Main Thread Interrupted"); } System.out.println("Main Thread Exiting"); } }Output:New Thread :Thread[One,5,main]New Thread : Thread[Two,5,main]One:5Two:5New Thread : Thread[Three,5,main]Three:5One:4Three:4Two:4One:3Three:3Two:3One:2Three:2Two:2One:1Three:1Two:1One exitingThree exitingTwo exitingMain Thread Exiting

Related Questions

What does not supported exiting mean?

What the message is saying is that the program or device is not supported by your computer and cannot be used so the computer is exiting or quiting out of the trying to use the program or device.


What are two ways of exiting medisoft?

the tab that say close or the red x


Why bats all ways turn left while exiting the cave?

because im cool


When exiting an alley or driveway drivers should?

Look both ways before you pull into the street.


Where might you make a parallel turn?

On a road you will find parallel turn there is 2 ways of exiting a junction


Describe two ways to get help in an office program?

two ways to get help in office program


Who is at fault in a collision between a car on the roadway reversing and one exiting a parking lot?

In Kentucky, the vehicle on the main roadway has the right-of-way, regardless of direction. The person exiting the parking lot, must yield to traffic!


Can java program can be written without main?

No, main() class is required to execute the program as that's the starting point of the program.


The main method of a program has?

The Java main method of a program is the place where the program execution begins. A main method would look like below public static void main(String[] args){ }


Can you pass a double solid line in or out of a driveway?

One of the ways you can cross a double or single yellow solid line is when you entering or exiting a driveway


What is the climax of story just lather that's all?

The climax in a story is the main event and usually the most 'exiting' part of a story.


Can a weight loss diet program help reduce nerve pain?

I'm afraid a weight loss diet program can't help you reduce nerve pain. One of the main ways this is done, however, is through chiropracting, not dieting.