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

JAVA¹æÔò ¿ª·¢Æª

±¾ÎĽéÉܵÄJAVA¹æÔòµÄ˵Ã÷·ÖΪ3¸öÖ÷Òª¼¶±ð£¬±¾ÆªÅׯúÁËÆ½Ê±¿ª·¢ÖкÜÉÙÓöµ½µÄÇé¿ö£¬ÄÇЩÓõñȽÏÉÙµÄÒÔºóÔٸ߼¶ÆªÀïÃæ³öÏÖ¡£²¢ÓÐÁù¸öÓÐÓõĹú¼ÊÈí¼þ¿ª·¢ÖØÒª×¢ÒâµÄÓйØStringµÄÎÊÌ⣬×ñÊØÁËÕâЩ¹æÔò¿ÉÒÔÌá¸ß³ÌÐòµÄЧÂÊ¡¢Ê¹´úÂëÓÖ¸üºÃµÄ¿É¶ÁÐԵȡ£
£¨1£© Èç¹ûÓÐJDBCÁ¬½ÓûÓйصôµÄ»°£¬ÐèÒªÔÚ"finally"·½·¨Öйصô
Èç¹ûÊý¾Ý¿âÁ¬½Óʧ°Ü»òÕßÊÇûÓÐÊÍ·ÅÁ¬½Ó£¬¿´ÉÏÈ¥Î޹ؽôÒª¡£µ«ÊÇÆäËûµÄÓû§¾ÍÐèÒªÓøü³¤µÄʱ¼äµÈ´ýÁ¬½Ó£¬ÕâÑùÊý¾Ý¿âÀûÓÃЧÂʾͻáϽµ¡£È·±£ÄãµÄ´úÂëÔÚÈκÎÇé¿öÏ£¬°üÀ¨³ö´í»òÕß³ÌÐòÒì³£ÖÕÖ¹µÄÇé¿ö϶¼ÊÍ·ÅÊý¾Ý¿âÁ¬½Ó¡£ÔÚ"finally"·½·¨ÖйصôÁ¬½Ó£¬¾Í¿ÉÒÔÈ·±£ÕâÒ»µã¡£
´íÎóʾÀý£º
try {
Statement stmt = con.createStatement();
} catch(SQLException e) {
e.printStackTrace();
}
ÕýȷʾÀý£º
try {
Statement stmt = con.createStatement();
} finally {
if (con != null && !con.isClosed()) {
con.close();
}
}
£¨2£© ¾¡Á¿±ÜÃâʹÓÃ'Thread.resume ()', 'Thread.stop ()', 'Thread.suspend ()'ºÍ 'Runtime.runFinalizersOnExit ()' ·½·¨¡£
ÕâЩ·½·¨ÔÚÆ½Ê±µÄ¿ª·¢»òÕßÊǽ̿ÆÊéÀïÃæÒ²ÓÐÓõ½¹ý£¬µ«ÊÇÕâЩ·½·¨»áµ¼ÖÂËÄËøµÄÇãÏò¡£Ò»ÏÂÓгä×ãµÄ×ÊÁÏÀ´ËµÃ÷Ϊʲô²»½¨ÒéÓÃÉÏÊö·½·¨¡£
²Î¿¼£º1."java.lang.Thread" in the JDK API documentation
2. http://java.sun.com/j2se/1.3/docs/guide/misc/threadPrimitiveDeprecation.html
3.Paul Hyde: "Java Thread Programming"
Sams, ISBN: 0-672-31585-8 pp. 270
£¨3£© ÔÚ±íʾ³¤Õû³£Á¿µÄʱºò£¬ÓÃLÀ´´úÌæl.
ÒòΪlºÜÈÝÒ׺Í1»ìÒ»Æð¡£
´íÎóʾÀý£º
long temp = 23434l;
ÕýȷʾÀý£º
long temp = 23434L;
²Î¿¼£ºKen Arnold, James Gosling: "The Java Programming Language Second Edition"Addison Wesley, 1997, pp.108
£¨4£© ×îºÃÔÚjsp¿ªÍ·Ð´Ò»Ìõ×¢ÊÍ
ÔÚ jspÎļþÍ·ÉÏÃæÐ´Ò»Ìõ×¢ÊÍ£¬ÕâÑù¿ÉÒÔ°ïÖú±ðÈËÀ´Àí½âÄãµÄ´úÂë¡£ÕâÌõ¹æÔò²»½öÊÊÓÃÓÚjsp£¬¸üÊÇÓÃÓÚÈκοª·¢µÄÎĵµ¡£
ÕýȷʾÀý£º<%-- JSP comment --%>
(5)Ã÷È·µÄ³õʼ»¯Ò»¸ö¹¹ÔìÀàÀïÃæµÄËùÓеÄ×Ö¶Î
ÒòΪûÓгõʼ»¯µÄ×ֶλáÊÇÒ»¸öDZÔÚµÄbug£¬ËùÒÔ×îºÃ³õʼ»¯ÀàÀïÃæµÄËùÓеÄ×ֶΡ£ÌرðÊǾ²Ì¬µÄ×ֶΣ¬×îºÃÔÚÒ»¿ªÊ¼¾Í·ÖÅäÒ»¸ö³õʼֵ
´íÎóʾÀý£º
public class CSI {
public CSI () {
this (12);
k = 0;
}
public CSI (int val) {
j = val;
}
private int i = 5;
private int j;
private int k;


Ïà¹ØÎĵµ£º

JAVA³ÌÐòÔ±ÃæÊÔ


1¡¢ÃæÏò¶ÔÏóµÄÌØÕ÷ÓÐÄÄЩ·½Ãæ  
1.³éÏ󣺳éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
2.¼Ì³Ð£º¼Ì³ÐÊÇÒ»ÖÖÁª½áÀàµÄ²ã´ÎÄ£ÐÍ£¬²¢ÇÒÔÊÐíºÍ ......

javaÃæÊÔÌâ »ù´¡Æª£¨1£©

1 Áо٠10¸öjavaÓïÑÔµÄÓÅÊÆ
        Ãâ·Ñ£¬¿ªÔ´£¬¿çƽ̨£¬¼òµ¥Ò×Ó㬹¦ÄÜÍêÉÆ£¬ÃæÏò¶ÔÏ󣬽¡×³ÐÔ£¬¶àỊ̈߳¬½á¹¹ÖÐÁ¢£¬
  ÆóÒµÓ¦ÓõijÉÊìÆ½Ì¨£¬ÎÞÏßÓ¦Óá£
2 ÁоÙjavaÖÐ 10¸öÃæÏò¶ÔÏó±à³ÌµÄÊõÓï
     °ü£¬À࣬ʵÀý£¬·â×°£¬¼Ì³Ð£¬¶à̬£¬ÖØÔØ£¬ÖØÐ´£¬¶Ô ......

ÅäÖÃJAVA¿ª·¢»·¾³

Ê×ÏȽéÉÜһϻ·¾³±äÁ¿µÄÉèÖ÷½·¨£º
£¨ÕâÀïÒÔjdk1.5À´°²×°£¬ÆäËû°æ±¾Ò»Ñù£©
ÔÚ°Ñjdk1.5°²×°µ½¼ÆËã»úÖÐÖ®ºó£¬ÎÒÃÇÀ´½øÐÐÉèÖÃʹjava»·¾³Äܹ»Ê¹Óá£
         Ê×ÏÈÓÒ¼üµãÎҵĵçÄÔ¡£´ò¿ªÊôÐÔ¡£È»ºóÑ¡Ôñ“¸ß¼¶”ÀïÃæµÄ“»·¾³±äÁ¿”£¬ÔÚеĴò¿ª½çÃæÖеÄϵͳ±äÁ¿Ð ......

ÈçºÎÒÔJavaʵÏÖÍøÒ³½ØÍ¼¼¼Êõ

½ñÌì¿´µ½Ä³ÍøÓѹØÓÚ“ÈçºÎÒÔJavaʵÏÖÍøÒ³½ØÍ¼¼¼Êõ”µÄ×ÉѯÌû£¬ÓÉÓÚ³öÏÖ¸Ã×ÉѯµÄµØµã·Ç³£²»ÊʺϽϳ¤»Ø¸´£¬¹ÊÒÔ²©ÎÄÐÎʽ»Ø´ð¡£
ÊÂʵÉÏ£¬Èç¹ûÄúÏëÒÔJavaʵÏÖÍøÒ³½ØÍ¼£¬Ò²¾ÍÊÇ“ÊäÈëÒ»¶ÎÍøÖ·£¬¼¸ÃëÖÓ¹ýºó¾ÍÄܽØÈ¡Ò»ÕÅÍøÒ³ËõÂÔͼ”µÄЧ¹û¡£ÄÇô£¬ÄúÖÁÉÙÓÐ3ÖÖ·½Ê½¿ÉÒÔÑ¡Ôñ¡£
1¡¢×îÖ±½ÓµÄ·½Ê½—— ......

Javaµ÷ÓÃLinuxÃüÁî

Java¿ÉÒÔÖ±½Óµ÷ÓÃLinuxÃüÁÐÎʽÈçÏ£º
 Runtime.getRuntime().exec(command)
 ¾ÙÀý£ºÔËÐÐls,topÃüÁî¿ÉÒÔÕâÑù£º
 Runtime.getRuntime().exec("ls");
 µ«ÊÇÕâÑùÖ´ÐÐʱûÓÐÈκÎÊä³ö£¬Ô­Òò£º 
 µ÷ÓÃRuntime.exec·½·¨½«²úÉúÒ»¸ö±¾µØµÄ½ø³Ì,²¢·µ»ØÒ»¸öProcess×ÓÀàµÄʵÀý£¬
£¨×¢Ò⣺Runtim ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ