摘要: java中启动多线程有两种方法,一是继承Thread类,二是实现Runnable接口。 继承Thread类: java中正确地启动多线程不能直接调用run()方法,而是调用从Thread类中继承而来的start()方法。 class myThead01 extends Thread { private String name; public myThead01(Stri... 阅读全文
posted @ 2014-08-05 15:31 塔斯曼 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 打包jar文件和设置class路径: 查看jar文件内容: 阅读全文
posted @ 2014-08-05 14:15 塔斯曼 阅读(120) 评论(0) 推荐(0) 编辑
摘要: public class RuntimeExceptionDemo01 { public static void main(String[] args) { String string="123"; int temp=Integer.parseInt(string); System.out.println("123*123=: "+temp*temp)... 阅读全文
posted @ 2014-08-05 10:28 塔斯曼 阅读(485) 评论(0) 推荐(0) 编辑
摘要: div的异常抛给main来处理: class Math{ public int div(int i,int j)throws Exception{ int temp=i/j; return temp; } } public class ThrowsDemo01 { public static void ... 阅读全文
posted @ 2014-08-05 09:46 塔斯曼 阅读(132) 评论(0) 推荐(0) 编辑