Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I run my code during waiting user input in JAVA

I am making a game in JAVA console. I want to show elapsed time ,waiting input from user.But I can’t run any code waiting input. How can ı run my codes during input wait?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You can create new Thread, define what it should do and start it.

Docs:

https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html

Check docs for java version you need. These are for version 7.

Also I suggest you to get some knowledge about parallel programming and using threads. There are plenty of material on the internet

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading