hilos jav

16
Clase ThreadCount package hilosjava; public class ThreadCount extends Thread{ int count, max; ThreadCount(int _max){ this.count = 1; this.max = _max; }public void run(){ while(this.count <= this.max){ System.out.print(" Conteo en:" + this.count + "\n"); this.count++; } } } Clase principal package hilosjava; public class MainClass { public static void main(String[] args) { ThreadCount hilo1 = new ThreadCount(10); hilo1.start(); } }

Upload: ramon-martinez-cruz

Post on 27-Sep-2015

216 views

Category:

Documents


3 download

DESCRIPTION

Hilos en Java

TRANSCRIPT

Clase ThreadCount

package hilosjava;

public class ThreadCount extends Thread{

int count, max;

ThreadCount(int _max){

this.count = 1;

this.max = _max;

}public void run(){

while(this.count