摘要:
方式一:1.创建一个继承Thread类的子类2.重写Thread类的run()3.创建Thread类的子类的对象4.通过此对象调用start() public class ThreadTest { public static void main(String[] args) { MyThread t 阅读全文
摘要:
1.继承现有的异常结构,RuntimeException,Exception 2.提供全局常量:serialVersionUID 3.提供重载的构造器 自定义异常类 public class MyException extends Exception{ static final long seria 阅读全文
摘要:
public class InnerClass { //返回一个实现了Comparable接口的类的对象 public Comparable getComparable(){ //创建一个实现了Comparable接口的类:局部内部类 class MyComparable implements Co 阅读全文
摘要:
public class ProxyTest { public static void main(String[] args) { Server server = new Server(); ProxyServer proxyServer = new ProxyServer(server); pro 阅读全文