Jump to content

Press any Key to Continue in Java

Go to solution Solved by fizzlesticks,

Pressing any key in java is overly complicated and not worth attempting.

 

The following will wait for enter to be pressed.

System.out.println("Press enter to continue...");try{        System.in.read();}catch(Exception e){	e.printStackTrace();}

Pressing any key in java is overly complicated and not worth attempting.

 

The following will wait for enter to be pressed.

System.out.println("Press enter to continue...");try{        System.in.read();}catch(Exception e){	e.printStackTrace();}

1474412270.2748842

Link to post
Share on other sites

I don't see why you wan't the "press any key to continue" function but I'm pretty sure that you've got your reasons.

 

 

Pressing any key in java is overly complicated and not worth attempting.

 

The following will wait for enter to be pressed.

System.out.println("Press enter to continue...");try{        System.in.read();}catch(Exception e){	e.printStackTrace();}

As he said, that would be one of the most efficient ways of doing it

Link to post
Share on other sites

I don't see why you wan't the "press any key to continue" function but I'm pretty sure that you've got your reasons.

 

As he said, that would be one of the most efficient ways of doing it

 

 

 

Pressing any key in java is overly complicated and not worth attempting.

 

The following will wait for enter to be pressed.

System.out.println("Press enter to continue...");try{        System.in.read();}catch(Exception e){	e.printStackTrace();}

Thanks guys. 

"When in doubt, don't take your wallet out." - Dad


 


† TTCF Member †

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×