实现代码
public class PrintNumber {public static void main(String[] args) {Print print new Print();new Thread(print, "线程1").start();new Thread(print, "线程2").start();}}class Print implements Runnable {private int num 1;Overridepub…
例子:
enum Type {Strong,Week
}class Java {helloJava(){console.log(hello Java);}
}class JavaScript {helloJavaScript(){console.log(hello JavaScript);}
}function getLanguage(type: Type){let lang type Type.Strong ? new Java() : new JavaScript();…