Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 11336

Java Threads

$
0
0
Faça assim: public class HelloRunnable implements Runnable { public String name = ""; public void run() { System.out.println("[Th "+name+"]Eu sou uma thread!"); } /** * @param args the command line arguments */ public static void main(String[] args) { for (String s : args) { HelloRunnable hr = new HelloRunnable(); hr.name = s; (new Thread(hr)).start(); } } }

Viewing all articles
Browse latest Browse all 11336

Trending Articles