Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class EjemploHilo4 implements Runnable {
- public void run() {
- System.out.println("Esto es otro hilo: " + Thread.currentThread());
- }
- public static void main(String []args) {
- ThreadGroup tg = new ThreadGroup("fumador");
- Thread eh3_1 = new Thread(tg, new EjemploHilo4(), "Ejemplo hilo 3 1");
- Thread eh3_2 = new Thread(tg, new EjemploHilo4(), "Ejemplo hilo 3 2");
- eh3_1.start();
- eh3_2.start();
- System.out.println("Estos un hilo " + Thread.currentThread());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement