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;
Ïà¹ØÎĵµ£º
package homework01;
public class TestWhile {
public static double factorial(int n) //Çó½×³Ëº¯Êý
{
if(n==0) return 1;
else return n* factorial(n-1);
}
public static void main(String[] args) {
System.out.println(factorial(170));//test:ÄÜ´òÓ¡³öÀ´£ ......
public class OuterClass
{
public class InnerClass
{
public int code = 100;
}
public static void main(String[] args)
{
OuterClass outer = new OuterClass();
OuterClass.InnerClass o = outer.new InnerClass();
System. ......
±¾ÆªÎÄÕÂÀ´Ô´ÓÚ£º¿ª·¢Ñ§Ôº http://edu.codepub.com ÔÎÄÁ´½Ó£ºhttp://edu.codepub.com/2010/0221/20469.php
½Ó¿ÚÉêÃ÷±ØÐëÓÐinterface¹Ø¼ü×ֺͽӿڵÄÃû×Ö£¬publicÖ¸Ã÷ÈÎÒâÀà¾ù¿ÉÒÔʹÓÃÕâ¸ö½Ó¿Ú£¬Ä¬ÈÏÇé¿öÏ£¬Ö»ÓÐÓë¸Ã½Ó¿Ú¶¨ÒåÔÚͬһ¸ö°üÖеÄÀà²Å¿ÉÒÔ·ÃÎÊÕâ¸ö½Ó¿Ú¡£extends ÓëÀà ......
²Ù×÷·û
1.λ²Ù×÷·û
(a) >>>ÓÒÒÆ£¬¸ßλÓÃ0Ìî³ä£»
int a = 14;
int b = 2;
System.out.println(a >>> b);// 3
int c = -14;
int d = 2;
System.out.println(c >>> d);// 1073741820
(b) >>·ûºÅλ²»±ä£¬ÆäËûλÓÒÒÆ£¬¸ßλÓÃ0Ìî³ä£¬Æä½á¹ûÓëa/2bÏàͬ£»
int a = 14;
int b = 2;
Sy ......
1£©DOM£¨JAXP Crimson½âÎöÆ÷£©
DOMÊÇÓÃÓëƽ̨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐÑ°ÕÒÌض¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó²ÅÄÜ×öÈκι¤×÷¡£ÓÉÓÚËüÊÇ»ùÓÚÐÅÏ¢²ã´ÎµÄ£¬Òò¶øDO ......