Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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×÷Òµ01

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:ÄÜ´òÓ¡³öÀ´£ ......

Java½â¶ÁÄڴ棬ÓÅ»¯±à³Ì

      Ò».´úÂëÓÅ»¯
¡¡¡¡ÄÚ´æ»áÒç³ö¿Ï¶¨ºÍ´úÂëÌÓ²»Á˹Øϵ,99.99%ѧjavaµÄÈ˶¼ÖªµÀÀ¬»ø»ØÊÕÆ÷ÊÇ javaµÄÒ»´óÓŵ㲢¾Ý´ËÀ´³°Ð¦C++¡£ÏÔÈ»Õâ¸öÌØÐÔΪ´úÂë±àдÕßÊ¡Á˲»ÉÙÊ£¬µ«Õâ¸öÌØÐÔÈ´´øÀ´Á˲»ÉÙÒþ»¼¡£¾Ù¸öÀý×ÓÔÚÓÎÏ·µ±Öо­³£Óв»Í¬³¡¾°µÄÇл»£¬Èç´ÓÓÎÏ·Âß¼­Í˵½Ö÷²Ëµ¥Âß¼­,¶ÔÓÎÏ·Âß¼­¶ÔÏóµÄ̬¶ ......

JAVA¶ÁÊé±Ê¼Ç£¨¶þ£©

²Ù×÷·û
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 ......

Java:Eclipse´úÂë×Ô¶¯Ìáʾ


EclipseÖÐĬÈÏÊÇÊäÈë"."ºó³öÏÖ×Ô¶¯Ìáʾ£¬ÓÃÓÚÀà³ÉÔ±µÄ×Ô¶¯Ìáʾ£¬¿ÉÊÇÓÐʱºòÎÒÃÇÏ£ÍûËüÄÜÔÚÎÒÃÇÊäÈëÀàµÄÊ××Öĸºó¾Í³öÏÖ×Ô¶¯Ìáʾ£¬¿ÉÒÔ½ÚÊ¡´óÁ¿µÄÊäÈëʱ¼ä£¨ËäÈ»°´alt + /»á³öÏÖÌáʾ£¬µ«»¹ÊÇÒª¶à°´Ò»´Î°´¼ü£¬Ì«Âé·³ÁË£©¡£
    ´ÓWindow -> preferences -> Java -> Editor -> Content assist - ......

ÿ¸öJava³õѧÕ߶¼¸ÃÃ÷°×µÄÎÊÌâ

ÿ¸öJava³õѧÕ߶¼Ó¦¸ÃÃ÷°×µÄÎÊÌâ
¶ÔÓÚÕâ¸öϵÁÐÀïµÄÎÊÌ⣬ÿ¸öѧJavaµÄÈ˶¼Ó¦¸Ã¸ã¶®¡£µ±È»£¬Èç¹ûÖ»ÊÇѧJavaÍæÍæ¾ÍÎÞËùνÁË¡£Èç¹ûÄãÈÏΪ×Ô¼ºÒѾ­³¬Ô½³õѧÕßÁË£¬È´²»ºÜ¶®ÕâЩÎÊÌ⣬Ç뽫Äã×Ô¼ºÖعé³õѧÕßÐÐÁС£ÄÚÈݾùÀ´×ÔÓÚCSDNµÄ¾­µäÀÏÌù¡£
¡¡¡¡ÎÊÌâÒ»£ºÎÒÉùÃ÷ÁËʲô£¡
String s = "Hello world!";
¡¡¡¡Ðí¶àÈ˶¼×ö¹ýÕâÑùµÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ