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);
}
}
Õ§Ò»¿´£¬Õâ¸ö³ÌÐò¿ÉÄÜ»á´òÓ¡100¡£±Ï¾¹£¬Ëü¶Ôj×öÁË100´ÎÔöÁ¿²Ù×÷¡£¿ÉÄÜ»áÁîÄã¸Ðµ½ÓÐЩÕ𾪣¬Ëü´òÓ¡µÄ²»ÊÇ100¶øÊÇ0¡£ËùÓеÄÔöÁ¿²Ù×÷¶¼ÎÞÓ°ÎÞ×ÙÁË£¬ÎªÊ²Ã´£¿
¾ÍÏñ±¾ÃÕÌâµÄÌâÄ¿Ëù°µÊ¾µÄ£¬ÎÊÌâ³öÔÚÁËÖ´ÐÐÔöÁ¿²Ù×÷µÄÓï¾äÉÏ£º
j = j++;
´ó¸Å¸ÃÓï¾äµÄ×÷ÕßÊÇÏëÈÃËüÖ´ÐжÔjµÄÖµ¼Ó1µÄ²Ù×÷£¬Ò²¾ÍÊDZí´ïʽj++Ëù×öµÄ²Ù×÷¡£Òź¶µÄÊÇ£¬×÷Õß´óßÖßֵؽ«Õâ¸ö±í´ïʽµÄÖµÓи³»Ø¸øÁËj¡£
µ±++²Ù×÷·û±»ÖÃÓÚÒ»¸ö±äÁ¿ÖµÖ®ºóʱ£¬Æä×÷ÓþÍÊÇÒ»¸öºó׺ÔöÁ¿²Ù×÷·û£¨postfix increment operator£©[JLS 15.14.2]£º±í´ïʽj++µÄÖµµÈÓÚjÔÚÖ´ÐÐÔöÁ¿²Ù×÷֮ǰµÄ³õʼֵ¡£Òò´Ë£¬Ç°ÃæÌáµ½µÄ¸³ÖµÓï¾äÊ×Ïȱ£´æjµÄÖµ£¬È»ºó½«jÉèÖÃΪÆäÖµ¼Ó1£¬×îºó½«j¸´Î»µ½ËüµÄ³õʼֵ¡£»»¾ä»°Ëµ£¬Õâ¸ö¸³Öµ²Ù×÷µÈ¼ÛÓÚÏÂÃæµÄÓï¾äÐòÁУº
int tmp = j;
j = j + 1;
j = tmp?;
³ÌÐòÖØ¸´¸Ã¹ý³Ì100´Î£¬Ö®ºójµÄÖµ»¹ÊǵÈÓÚËüÔÚÑ»·¿ªÊ¼Ö®Ç°µÄÖµ£¬¼´0¡£
¶©Õý¸Ã³ÌÐò·Ç³£¼òµ¥£¬Ö»Ðè´ÓÑ»·ÖÐÒÆ³ýÎ޹صĸ³Öµ²Ù×÷£¬Ö»ÁôÏ£º
for (int i = 0; i < 100; i++)
j++;
¾¹ýÕâÑùµÄÐ޸쬳ÌÐò¾Í¿ÉÒÔ´òÓ¡³öÎÒÃÇËùÆÚÍûµÄ100ÁË¡£
ÕâÓëÃÕÌâ7ÖеĽÌѵÏàͬ£º²»ÒªÔÚµ¥¸öµÄ±í´ïʽÖжÔÏàͬµÄ±äÁ¿¸³Öµ³¬¹ýÒ»´Î¡£¶ÔÏàͬµÄ±äÁ¿½øÐжà´Î¸³ÖµµÄ±í´ïʽ»á²úÉú»ìÏý£¬²¢ÇÒºÜÉÙÄܹ»²úÉúÄãÏ£ÍûµÄÐÐΪ¡£
Ïà¹ØÎĵµ£º
JavaÕýÔò±í´ïʽÏê½â
2005-10-08 10:01×÷ÕߣºÏÉÈËÕÆ¹¤×÷ÊÒ³ö´¦£ºKissJava.comÔðÈα༣ºÍõÓñº
Èç¹ûÄãÔø¾ÓùýPerl»òÈÎºÎÆäËûÄÚ½¨ÕýÔò±í´ïʽ֧³ÖµÄÓïÑÔ£¬ÄãÒ»¶¨ÖªµÀÓÃÕýÔò±í´ïʽ´¦ÀíÎı¾ºÍÆ¥ÅäģʽÊǶàô¼òµ¥¡£Èç¹ûÄã²»ÊìϤÕâ¸öÊõÓÄÇô“ÕýÔò±í´ïʽ”£¨Regular Expression£©¾ÍÊÇÒ»¸ö×Ö·û¹¹³ÉµÄ´®£¬Ëü¶¨ÒåÁ ......
ÖÚËùÖÜÖª£¬JavaÓïÑÔÊÇÒ»Ãŷdz£ÊʺÏÍøÂ翪·¢µÄÓïÑÔ£¬Óà JavaÓïÑÔ½øÐÐÐÔÄܲâÊԽű¾¿ª·¢½«»á´ó´óÌá¸ß²âÊÔ¿ª·¢Ð§ÂÊ¡£LoadRunnerÖÐÌṩÁ˶ÔJavaÐéÄâÓû§µÄÖ§³Ö¡£JavaÐéÄâÓû§ÒÀÍÐÓÚJDK£¬Õâ´ó´óÀ©³äÁËLoadRunnerµÄ½Å±¾¿ª·¢¹¦ÄÜ¡£²âÊÔÈËÔ±¼È¿ÉÒÔÓÃJavaÐéÄâÓû§À´²âÊÔ»ùÓÚJavaµÄÓ¦ÓÃϵͳµÄÐÔÄÜ£¬ÓÖ¿ÉÒÔʹÓÃJavaÓïÑÔµÄÇ¿´ó¿ª·¢½Å±¾ ......
Õⲿ·ÖµÄÖ÷ÒªÄÚÈÝ£º
µÚÒ»£¬Java WebÓ¦Óûù´¡¸´Ï°
µÚ¶þ£¬MVCµÄÉè¼ÆÄ£Ê½
µÚÈý£¬StrutsµÄÉè¼ÆÄ£Ê½
µÚÒ»²¿·Ö£ºJava WebµÄÓ¦Óûù´¡
Java WebµÄºËÐļ¼ÊõÊÇJSPºÍServlet¼¼Êõ¡£
ͼһ£¬Java WebµÄÓ¦ÓõĽṹͼ
1£¬ServletÓëJSP
Servlet×é¼þÊÇÒ»¸öÓëÐÒéÎÞ¹ØµÄ¿çÆ½Ì¨µÄ·þÎñÆ÷×é¼þ¡£ServletµÄ×÷ÓÃÊǶÁÈ¡¿Í»§·¢Ë͵ÄÏÔʾΪÊý¾Ý¡¢ ......
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
impo ......
1¡¢Óï·¨£º±ØÐë±È½ÏÊìϤ£¬ÔÚд´úÂëµÄʱºòIDEµÄ±à¼Æ÷¶ÔijһÐб¨´íÓ¦¸ÃÄܹ»¸ù¾Ý±¨´íÐÅÏ¢ÖªµÀÊÇʲôÑùµÄÓï·¨´íÎó²¢ÇÒÖªµÀÈκÎÐÞÕý¡£
2¡¢ÃüÁ±ØÐëÊìϤJDK´øµÄһЩ³£ÓÃÃüÁî¼°Æä³£ÓÃÑ¡ÏÃüÁîÖÁÉÙÐèÒªÊìϤ£ºappletviewer¡¢ HtmlConverter¡¢jar¡¢ java¡¢javac¡¢javadoc¡¢javap¡¢javaw¡¢native2ascii¡¢serialver£¬Èç¹ûÕâЩÃüÁ ......