Skip to content

Instantly share code, notes, and snippets.

@HackMEAny
Created July 22, 2026 15:14
Show Gist options
  • Select an option

  • Save HackMEAny/3245397367e400c78599a682fbcc5276 to your computer and use it in GitHub Desktop.

Select an option

Save HackMEAny/3245397367e400c78599a682fbcc5276 to your computer and use it in GitHub Desktop.
Debugging Multi-threaded Java Applications
package ani_test;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
class executer implements Runnable {
int id = 0;
executer(int id) {
System.out.println("Inside Executer -->>");
this.id = id;
}
@Override
public void run() {
Thread.currentThread().setName("D3f4ult_" + id);
System.out.println("EXECUTER HIT id = " + this.id);
}
}
public class InterThread {
public static void main(String[] args) {
ExecutorService aa = Executors.newFixedThreadPool(5);
for (int i = 0; i < 5; i++) {
aa.execute(new executer(i));
}
aa.shutdown();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment