贴一个唯一可以new 接口的代码

如下:

 

<textarea cols="50" rows="15" name="code" class="c-sharp">/** * */ package test; /** * @author Administrator * */ public class Threads4 { public static void main(String[] args) throws InterruptedException { new Threads4().go(); } public void go() { Runnable r = new Runnable() { public void run() { System.out.print("test"); } }; Thread t = new Thread(r); t.start(); } }</textarea>

你可能感兴趣的:(thread,String,Class,Go)