Advertisement
Joaquin_Hidalgo

Hilo_p4

Sep 12th, 2024
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. package punto_04;
  2.  
  3. public class Hilo_p4 extends Thread {
  4.     private char letra;
  5.  
  6.     public Hilo_p4(String nombreHilo, char letra) {
  7.         super(nombreHilo);
  8.         this.letra = letra;
  9.     }
  10.  
  11.     public void run() {
  12.         for (int i = 0; i < 10; i++) {
  13.             System.out.println(this.letra + "_" + getName());
  14.             Thread.yield();
  15.         }
  16.     }
  17.  
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement