Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java½â»ó4 37¼«¶Ë²»¿É˼Òé

±¾ÃÕÌâ²âÊÔµÄÊÇÄã¶ÔijЩ¹æÔòµÄÕÆÎճ̶ȣ¬ÕâЩ¹æÔòÓÃÓÚÉùÃ÷´Ó·½·¨ÖÐÅ׳ö²¢±»catchÓï¾ä¿éËù²¶»ñµÄÒì³£¡£ÏÂÃæµÄÈý¸ö³ÌÐòÿһ¸ö¶¼»á´òӡЩʲô£¿²»Òª¼ÙÉèËüÃǶ¼¿ÉÒÔͨ¹ý±àÒ룺
import java.io.IOException;
public class Arcane1 {
public static void main(String[] args) {
try {
System.out.println("Hello world");
} catch(IOException e) {
System.out.println("I've never seen
println fail!");
}
}
}
public class Arcane2 {
public static void main(String[] args) {
try {
// If you have nothing nice to say, say nothing
} catch(Exception e) {
System.out.println("This can't
happen");
}
}
}
interface Type1 {
void f() throws CloneNotSupportedException;
}
interface Type2 {
void f() throws InterruptedException;
}
interface Type3 extends Type1, Type2 {
}
public class Arcane3 implements Type3 {
public void f() {
System.out.println("Hello world");
}
public static void main(String[] args) {
Type3 t3 = new Arcane3();
t3.f();
}
}
µÚÒ»¸ö³ÌÐò£¬Arcane1£¬Õ¹Ê¾Á˱»¼ì²éÒì³£µÄÒ»¸ö»ù±¾Ô­Ôò¡£Ëü¿´ÆðÀ´Ó¦¸ÃÊÇ¿ÉÒÔ±àÒëµÄ£ºtry×Ó¾äÖ´ÐÐI/O£¬²¢ÇÒcatch×Ӿ䲶»ñIOExceptionÒì³£¡£µ«ÊÇÕâ¸ö³ÌÐò²»ÄܱàÒ룬ÒòΪprintln·½·¨Ã»ÓÐÉùÃ÷»áÅ׳öÈκα»¼ì²éÒì³££¬¶øIOExceptionÈ´ÕýÊÇÒ»¸ö±»¼ì²éÒì³£¡£ÓïÑԹ淶ÖÐÃèÊöµÀ£ºÈç¹ûÒ»¸öcatch×Ó¾äÒª²¶»ñÒ»¸öÀàÐÍΪEµÄ±»¼ì²éÒì³££¬¶øÆäÏà¶ÔÓ¦µÄtry×Ӿ䲻ÄÜÅ׳öEµÄijÖÖ×ÓÀàÐ͵ÄÒì³££¬ÄÇôÕâ¾ÍÊÇÒ»¸ö±àÒëÆÚ´íÎó[JLS 11.2.3]¡£
»ùÓÚͬÑùµÄÀíÓÉ£¬µÚ¶þ¸ö³ÌÐò£¬Arcane2£¬¿´ÆðÀ´Ó¦¸ÃÊDz»¿ÉÒÔ±àÒëµÄ£¬µ«ÊÇËüÈ´¿ÉÒÔ¡£ËüÖ®ËùÒÔ¿ÉÒÔ±àÒ룬ÊÇÒòΪËüΨһµÄcatch×Ó¾ä¼ì²éÁËException¡£¾¡¹ÜJLSÔÚÕâÒ»µãÉÏÊ®·Öº¬»ì²»Ç壬µ«ÊDz¶»ñException»òThrowbleµÄcatch×Ó¾äÊǺϷ¨µÄ£¬²»¹ÜÓëÆäÏà¶ÔÓ¦µÄtry×Ó¾äµÄÄÚÈÝΪºÎ¡£¾¡¹ÜArcane2ÊÇÒ»¸öºÏ·¨µÄ³ÌÐò£¬µ«ÊÇcatch×Ó¾äµÄÄÚÈÝÓÀÔ¶µÄ²»»á±»Ö´ÐУ¬Õâ¸ö³ÌÐòʲô¶¼²»»á´òÓ¡¡£
µÚÈý¸ö³ÌÐò£¬Arcane3£¬¿´ÆðÀ´ËüÒ²²»ÄܱàÒë¡£·½·¨fÔÚType1½Ó¿ÚÖÐÉùÃ÷ÒªÅ׳ö±»¼ì²éÒì³£CloneNotSupportedException£¬²¢ÇÒÔÚType2½Ó¿ÚÖÐÉùÃ÷ÒªÅ׳ö±»¼ì


Ïà¹ØÎĵµ£º

IBM FileNet Content Java API ¼ò½é

2008 Äê 6 ÔÂ 24 ÈÕ
Ô­ÎĵØÖ·£º http://www.ibm.com/developerworks/cn/data/library/techarticles/dm-0806wangys/
±¾ÎĽéÉÜ IBM FileNet P8 4.0 Platform ÌṩµÄ Content Java API¡£Ê×ÏÈ¶Ô FileNet P8 Content Engine ºÍ API ½øÐиÅÒª½éÉÜ, ²¢ËµÃ÷ÁËһЩ»ù±¾¸ÅÄËæºóÏêϸ½éÉÜÁË FileNet Content EngineÌṩµÄ»ùÓÚ EJB ......

Java½â»ó2 25ÎÞÇéµÄÔöÁ¿²Ù×÷

ÏÂÃæµÄ³ÌÐò¶ÔÒ»¸ö±äÁ¿Öظ´µØ½øÐÐÔöÁ¿²Ù×÷£¬È»ºó´òÓ¡ËüµÄÖµ¡£ÄÇôÕâ¸öÖµÊÇʲôÄØ£¿
public class Increment {
public static void main(String[] args) {
int j = 0;
for (int i = 0; i < 100; i++)
j = j++;
System.out.println(j);
}
}
Õ§Ò»¿´£¬Õâ¸ö³ÌÐò¿ÉÄÜ» ......

Java½â»ó3 33Ñ­»·ÕßÓöµ½ÁËÀÇÈË

ÇëÌṩһ¸ö¶ÔiµÄÉùÃ÷£¬½«ÏÂÃæµÄÑ­»·×ª±äΪһ¸öÎÞÏÞÑ­»·¡£Õâ¸öÑ­»·²»ÐèҪʹÓÃÈκÎ5.0°æµÄÌØÐÔ£º
while (i != 0 && i == -i) {
}
ÕâÈÔÈ»ÊÇÒ»¸öÑ­»·¡£ÔÚ²¼¶û±í´ïʽ(i != 0 && i == -i)ÖУ¬Ò»Ôª¼õºÅ²Ù×÷·û×÷ÓÃÓÚi£¬ÕâÒâζ×ÅËüµÄÀàÐͱØÐëÊÇÊý×ÖÐ͵ģºÒ»Ôª¼õºÅ²Ù×÷·û×÷ÓÃÓÚÒ»¸ö·ÇÊý×ÖÐͲÙ×÷ÊýÊÇ·Ç·¨µÄ¡£Òò´Ë£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ