tags:

views:

616

answers:

4

is there any system("PAUSE") like thing in java

+1  A: 

You mean like Thread.sleep()? Please elaborate if you want further help...

RichardOD
+1  A: 

I don't know Java very well, but if you want to debug, then you may want to use debugger, and breakpoints for pausing execution. If you just want to wait for keyboard input, then check out System.in.read, or something similar.

PiotrLegnica
+7  A: 

Doing debugging is best done with a debugger, NetBeans (what you seem to be using if I look at other questions you have asked) has one. Just click in the left margin of an editor window to set a breakpoint and run the debugger. Program execution will stop at the breakpoint and you can have a look at the current state of variables, or step through the program line by line.

Jeroen van Bergen
I second the debugger. Learn how to use it and it will make your development life *much* easier. There are many links on the web. Here's one to help you get started: Getting Started with Netbeans - http://java.sun.com/developer/onlineTraining/tools/netbeans_part1/#debugging
JasCav
awesome! thanks
kokokok
+1  A: 

If you are attempting to debug, use a debugger. Netbeans and Eclipse both have one built in, and I am sure there are others.

If you are trying to get a thread to wait on another thread, use a thread.join().

aperkins