Answer the question
In order to leave comments, you need to log in
How to do two cycles at the same time
Faced such a problem that two loops in Java would work simultaneously. How to do it? (while(){} loops)
Answer the question
In order to leave comments, you need to log in
You need a multi-threaded application. There are quite a few options for how to run multiple threads at the same time. Simplest:
Thread thread1 = new Thread(new Runnable() {
public void run() {
while (....)
....
}
});
Thread thread2 = new Thread(new Runable() {
public void run() {
while (....)
....
}
});
thread1.start();
thread2.start();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question