??xml version="1.0" encoding="utf-8" standalone="yes"?>永久免费av片在线观看全网站,日韩专区视频网站,亚洲2区在线 http://www.aygfsteel.com/alinglau36/archive/2015/07/30/344970.html#426509?/dc:creator>?/author>Thu, 30 Jul 2015 03:35:00 GMT http://www.aygfsteel.com/alinglau36/archive/2015/07/30/344970.html#426509 Z错,是排版有点不好看啊 ]]> re: Freemarker操作字符?/title> http://www.aygfsteel.com/alinglau36/archive/2014/07/31/344970.html#416410王力?/dc:creator>王力?/author>Thu, 31 Jul 2014 07:38:00 GMT http://www.aygfsteel.com/alinglau36/archive/2014/07/31/344970.html#416410 ]]> 发生大幅杀?/title> http://www.aygfsteel.com/alinglau36/archive/2013/04/07/344970.html#397463发生大幅 发生大幅 Sun, 07 Apr 2013 07:04:00 GMT http://www.aygfsteel.com/alinglau36/archive/2013/04/07/344970.html#397463 ]]> re: java模拟q发操作q行压力试 http://www.aygfsteel.com/alinglau36/archive/2012/10/18/322118.html#389791东笑a 东笑a Thu, 18 Oct 2012 02:20:00 GMT http://www.aygfsteel.com/alinglau36/archive/2012/10/18/322118.html#389791 ]]>re: 语言深入:java中究竟是传D是传引用 http://www.aygfsteel.com/alinglau36/archive/2011/03/07/261747.html#345898lau lau Mon, 07 Mar 2011 11:02:00 GMT http://www.aygfsteel.com/alinglau36/archive/2011/03/07/261747.html#345898 ]]>re: CSS hack:区分IE6QIE7Qfirefox http://www.aygfsteel.com/alinglau36/archive/2011/02/12/312528.html#344154lau lau Sat, 12 Feb 2011 09:30:00 GMT http://www.aygfsteel.com/alinglau36/archive/2011/02/12/312528.html#344154 background:orange; /*for all (包括FF)*/ background:red\0; /*for ie8*/ *background:green; /*for ie7,ie6*/ _background:blue; /*for ie6 ,注意Q这个会重写前面*background的样?/ } ]]>re: Web browser hacks, Css hacks - ie, firefox, chrome, safri, Opera http://www.aygfsteel.com/alinglau36/archive/2011/02/12/312518.html#344138lau lau Sat, 12 Feb 2011 07:09:00 GMT http://www.aygfsteel.com/alinglau36/archive/2011/02/12/312518.html#344138 http://shishi11.javaeye.com/blog/840719 ]]> re: 你不知道?JavaScript - “this?/title> http://www.aygfsteel.com/alinglau36/archive/2011/02/09/344000.html#344003lau lau Wed, 09 Feb 2011 15:46:00 GMT http://www.aygfsteel.com/alinglau36/archive/2011/02/09/344000.html#344003 http://www.quirksmode.org/js/this.html ]]> re: YAHOO.util.Dom之寻找节?? http://www.aygfsteel.com/alinglau36/archive/2011/02/01/343835.html#343836lau lau Tue, 01 Feb 2011 00:56:00 GMT http://www.aygfsteel.com/alinglau36/archive/2011/02/01/343835.html#343836 http://blog.csdn.net/ilibaba/archive/2009/06/07/4248932.aspx JavaScript(YUI)扫盲 ]]> re: CSS hack:区分IE6QIE7Qfirefox http://www.aygfsteel.com/alinglau36/archive/2011/01/31/312528.html#343808lau lau Mon, 31 Jan 2011 06:05:00 GMT http://www.aygfsteel.com/alinglau36/archive/2011/01/31/312528.html#343808 ]]>re: 如何避免在Java中用Checked Exception http://www.aygfsteel.com/alinglau36/archive/2010/11/15/255045.html#338123lau lau Mon, 15 Nov 2010 10:43:00 GMT http://www.aygfsteel.com/alinglau36/archive/2010/11/15/255045.html#338123 首先Q您应该知道的是Java 提供了两UException 的模式,一U是执行的时候所产生的Exception (Runtime Exception)Q另外一U则是受控制的Exception (Checked Exception)?br> 所有的Checked Exception 均从java.lang.Exception l承而来Q而Runtime Exception 则承java.lang.RuntimeException 或java.lang.Error (实际上java.lang.RuntimeException 的上一层也是java.lang.Exception)?br> 当我们撰写程序的时候,我们很可能会寚w择某种形式的Exception 感到困扰Q到底我应该选择Runtime Exception q是Checked Exception Q?br> 其实Q在q作上,我们可以通过Class 的Method 如何产生某个Exception以及某个E序如何处理q个被生来的Exception 来了解它们之间的差异?br>首先我们先徏立一个Exception public class CException extends Exception { public CException() {} public CException(String message) { super(message); } } 然后我们撰写一个可能?CException ?Class public class testException { public void method1() throws CException { throw new CException("Test Exception"); } public void method2(String msg) { if(msg == null) { throw new NullPointerException("Message is null"); } } public void method3() throws CException { method1(); } // 以下省略 // ... } 在这三个method 中,我们看到了method1 和method2 的程序码内都会生ExceptionQ但method3 的程序码?大括号内)Qƈ没生ExceptionQ但在method3 的定义中Q暗CZq个method 可能产生CException?br> 呼叫method1() 的程序,必须method1() 包含在try 与catch 中,如: public class runtest { // .... public static void main(String argv[]) { testException te = new testException(); try { te.method1(); } catch(CException ce) { // .... } } // ... } 虽然包含在try 与catch 中,q不表示q段E序码一定会收到CExceptionQ但它的用意在于提醒呼叫者,执行q个method 可能产生的意外,而用者也必须要能针对q个意外做出相对应的处理方式?br> 当用者呼叫method2() Ӟq不需要用try 和catch 程序码包v来,因ؓmethod2 的定义中Qƈ没有throws M的Exception Q如Q?br> public class runtest { // .... public static void main(String argv[]) { testException te = new testException(); // 不会产生 Exception te.method2("Hello"); // 会?Exception te.method2(null); } // ... } E序在执行的时候,也不见得会真的生NullPointerException Q这UException 叫做runtime exception 也有人称为unchecked exception Q生Runtime Exception 的method (在这个范例中是method2) q不需要在宣告method 的时候定义它会产生哪一UException ?br> 在testException 的method3() 中,我们看到了另外一U状况,也就是method3里呼叫了method1() Q但却没有将method1 包在try 和catch 之间。相反,在method3() 的定义中Q它定义了CExceptionQ实际上是如果method3 收到了CException Q它不处理q个CException Q而将它往外丢。当Ӟ׃method3 的定义中有throws CException Q因此呼叫method3 的程序码也需要有try catch 才行?br> 因此从程序的q作机制上看QRuntime Exception与Checked Exception 不一P然而从逻辑上看QRuntime Exception 与Checked Exception 在用的目的上也不一栗?br> 一般而言QChecked Exception 表示q个Exception 必须要被处理Q也是说程序设计者应该已l知道可能会收到某个Exception(因ؓ要try catch? Q所以程序设计者应该能针对q些不同的Checked Exception 做出不同的处理?br> 而Runtime Exception 通常会暗C着E序上的错误Q这U错误会DE序设计者无法处理,而造成E序无法l箋执行下去?br> 看看下面的例子: String message[] = {"message1", "message2","message3"}; System.out.println(message[3]); q段E序码在Compile 时ƈ没问题,但在执行时则会出现ArrayIndexOutOfBoundException 的例外,在这U状况下Q我们亦无法针对q个Runtime Exception 做出有意义的动作Q这像是我们呼叫了testException 中的method2 Q却引发了它的NullPointerException 一P在这U状况下Q我们必dE序码进行修改,从而避免这个问题?br> 因此Q实际上我们应该也必要L取所有的Checked ExceptionQ同时最好能在这些Checked Exception 发生的时候做出相对应的处理,好让E序能面对不同的状况?br> 然而对于Runtime Exception Q有些h它catch 住,然后导向其它地方Q让E序l箋执行下去Q这U作法ƈ非不好,但它会让我们在某些测试工具下认ؓ我们的程序码没有问题Q因为我们将Runtime Exception "处理"掉了Q事实却不然Q譬如很多h的习惯是在程序的q入点后用个大大的try catch 包v来,如: public class runtest1 { public static void main(String argv[]) { try { //... } catch(Exception e) { } } } 在这U情况下Q我们很可能会不知道发生了什么Exception 或是从哪一行发出的Q因此在面对不同的Checked ExceptionӞ我们可已分别去try catch它。而在试阶段Ӟ如果到Runtime Exception Q我们可以让它就q样发生Q接着再去修改我们的程序码Q让它避免Runtime ExceptionQ否则,我们应该仔l追I每一个Exception Q直到我们可以确定它不会有Runtime Exception 为止Q?br> 对于Checked Exception 与Runtime Exception Q我惛_该有不少Z有不同的观点Q无论如何,E序先要能执行,q些Exception 才有Z产生。因此,我们可以把这些Exception 当成是Bug Q也可以当成是不同的状况(Checked Exception)Q或当成是帮助我们除错的工具(Runtime Exception)Q但前提是我们需要处理这些Exception Q如果不处理Q那么问题或状况׃永远留在那里?img src ="http://www.aygfsteel.com/alinglau36/aggbug/338123.html" width = "1" height = "1" /> ]]>re: The project cannot be built until build path errors are resolved http://www.aygfsteel.com/alinglau36/archive/2010/07/13/279259.html#325979Sunday Sunday Tue, 13 Jul 2010 09:12:00 GMT http://www.aygfsteel.com/alinglau36/archive/2010/07/13/279259.html#325979 ]]>re: 语言深入:java中究竟是传D是传引用 http://www.aygfsteel.com/alinglau36/archive/2010/04/20/261747.html#318831lau lau Tue, 20 Apr 2010 03:32:00 GMT http://www.aygfsteel.com/alinglau36/archive/2010/04/20/261747.html#318831 ]]>re: 语言深入:java中究竟是传D是传引用 http://www.aygfsteel.com/alinglau36/archive/2010/04/20/261747.html#318826lau lau Tue, 20 Apr 2010 03:16:00 GMT http://www.aygfsteel.com/alinglau36/archive/2010/04/20/261747.html#318826 8Ubyte char short int long float double boolean ]]> re: Eclipse+Tomcat调试时的一些错误笔记[未登录] http://www.aygfsteel.com/alinglau36/archive/2009/09/30/263123.html#297006111 111 Wed, 30 Sep 2009 05:17:00 GMT http://www.aygfsteel.com/alinglau36/archive/2009/09/30/263123.html#297006 nohup java -Xms128m -Xmx256m -Dfile.encoding=GB2312 -cp $CLASSPATH ]]>
վ֩ģ壺
ƽ˳ |
ľ |
̨ |
ϳ |
̨ |
û |
|
|
|
ν |
ϲ |
|
|
|
|
˫Ѽɽ |
¹ |
|
|
̶ |
|
ǰ |
ˮ |
γ |
|
ֶ |
|
|
û |
|
|
|
ɽ |
|
żҿ |
|
|
|
|
|
|