[Coding] Threading Difference In C # and Java

xiaoxiao2021-03-06  56

C # using System.Threading; public class myThread {static public void RunThread () {/ * do work * /}} public class TestThread {public static main () {Thread NotifyThread = new Thread (new ThreadStart (myThread.RunThread)); }

Javapublic class myThread implements Runable {public void run () // must override run () {try {/ * do work * / Thread.sleep (SLEEP_TIME); // let the other threads run} catch (InterruptedException e) {.. .

转载请注明原文地址:https://www.9cbs.com/read-83566.html

New Post(0)