摘要: 1 /* 2 try - catch语句的例子,模拟向货船上装载集装箱 3 ,如果货船超重,那么货船认为这是一个异常,将拒绝装载集装箱, 4 但无论是否发生异常,货船都需要正点起航。 5 */ 6 package st; 7 class DangerException ex... 阅读全文
posted @ 2014-05-06 16:58 龚细军 阅读(1172) 评论(0) 推荐(0)
摘要: 1 //异常类 2 package st; 3 public class example_1 4 { 5 public static void main(String args[]) 6 { 7 int n=0,m=0,t=1000; 8 try 9... 阅读全文
posted @ 2014-05-06 15:28 龚细军 阅读(489) 评论(0) 推荐(0)
摘要: 1 package st; 2 //内部类 3 class RedCowForm 4 { 5 static String formName; 6 RedCow cow; 7 RedCowForm(){} 8 RedCowForm(String s){ 9 ... 阅读全文
posted @ 2014-05-06 14:44 龚细军 阅读(246) 评论(0) 推荐(0)