¹ØÓÚjavaµÄ++ºÍ
public class JavaPlus {
public static void main(String[] args) {
int x = 5;
x++;// x = x + 1;//ºó¼Ó¼Ó
System.out.println(x);
x--;// x = x - 1;//ºó¼õ¼õ
System.out.println(x);
++x;// x = x + 1;//Ç°¼Ó¼Ó
System.out.println(x);
--x;// x = x - 1;//Ç°¼õ¼õ
System.out.println(x);
int y = 20;
int z = y + x++;// ÏȲÎÓÚÔËË㣬ÔÙ½øÐмӼÓ
System.out.println("z=" + z);
System.out.println("x=" + x);
z = y + x--;// ÏȲÎÓÚÔËË㣬ÔÙ½øÐмõ¼õ
System.out.println("z=" + z);
System.out.println("x=" + x);
x = 10;
y = 20;
z = y + ++x;// ÏȼӼӣ¬ÔÙ²ÎÓÚÔËËã
System.out.println("x=" + x);
System.out.println("z=" + z);
z = y + --x;// ÏȼӼӣ¬ÔÙ²ÎÓÚÔËËã
System.out.println("x=" + x);
System.out.println("z=" + z);
}
}
¿ØÖÆ̨Êä³ö:
6
5
6
5
z=25
x=6
z=26
x=5
x=11
z=31
x=10
z=30
Ïà¹ØÎĵµ£º
1.ËãÊõÔËËã·û
JavaµÄËãÊõÔËËã·û·ÖΪһԪÔËËã·ûºÍ¶þÔªÔËËã·û¡£Ò»ÔªÔËËã·ûÖ»ÓÐÒ»¸ö²Ù×÷Êý£»¶þÔªÔËËã·ûÓÐÁ½¸ö²Ù×÷Êý£¬ÔËËã·ûλÓÚÁ½¸ö²Ù×÷ÊýÖ®¼ä¡£ËãÊõÔËËã·ûµÄ²Ù×÷Êý±ØÐëÊÇÊýÖµÀàÐÍ¡£
(1)Ò»ÔªÔËËã·û£º
Ò»ÔªÔËËã·ûÓУºÕý£¨+£©¡¢¸º£¨££©¡¢¼Ó1£¨++£©ºÍ¼õ1£¨£££ ......
Ò»¡¢Ê²Ã´ÊÇJavaÊÂÎñ
¡¡¡¡Í¨³£µÄ¹ÛÄîÈÏΪ£¬ÊÂÎñ½öÓëÊý¾Ý¿âÏà¹Ø¡£
¡¡¡¡ÊÂÎñ±ØÐë·þ´ÓISO/IECËùÖƶ¨µÄACIDÔÔò¡£ACIDÊÇÔ×ÓÐÔ£¨atomicity£©¡¢Ò»ÖÂÐÔ£¨consistency£©¡¢¸ôÀëÐÔ£¨isolation£©ºÍ³Ö¾ÃÐÔ£¨durability£©µÄËõд¡£ÊÂÎñµÄÔ×ÓÐÔ±íʾÊÂÎñÖ´Ðйý³ÌÖеÄÈκÎʧ°Ü¶¼½«µ¼ÖÂÊÂÎñËù×öµÄÈκÎÐÞ¸ÄʧЧ¡£Ò»ÖÂÐÔ±íʾµ±ÊÂÎñÖ´ÐÐʧ°Ü ......
Ò»°ãÀ´Ëµ,ÎÒÃÇ°ÑÕýÔÚ¼ÆËã»úÖÐÖ´ÐеijÌÐò½Ð×ö"½ø³Ì"(Process) ,¶ø²»½«Æä³ÆΪ³ÌÐò(Program)¡£Ëùν"Ïß³Ì"(Thread),ÊÇ"½ø³Ì"ÖÐij¸öµ¥Ò»Ë³ÐòµÄ¿ØÖÆÁ÷¡£ÐÂÐ˵IJÙ×÷ϵͳ,ÈçMac,Windows NT,Windows 95µÈ,´ó¶à²ÉÓöàÏ̵߳ĸÅÄî,°ÑÏß ³ÌÊÓΪ»ù±¾Ö´Ðе¥Î»¡£Ïß³ÌÒ²ÊÇJavaÖеÄÏ൱ÖØÒªµÄ×é³É²¿·ÖÖ®Ò»¡£
ÉõÖÁ×î¼òµ¥µÄAppletÒ²ÊÇÓɶà¸öÏß ......
À´¸ö¼òµ¥µãµÄ£º
1.½¨¸ö¾ßÌåµÄ·þÎñʵÏÖ£º
package com.webservice;
@WebService
public class Warehouse {
private Map<String, Double> prices;
public Warehouse() {
prices = new HashMap<String, Double>();
prices.put("Blackwell Toaster", 24.95);
& ......
²»µÃÒÑ+×Ô¼ºÆäʵͦÏëѧµÄ£¬ÀÏʦÔÚÔ¶³Ì½ÌÓýÔÀíÕâÃſγ̸ÄΪ½ÌÊÚjava¡£
×ÔºÀµÄ˵һ¾ä£¬Æäʵµ±ÄêѧCÓïÑÔµÄʱºò£¬»ù´¡ÊÇ´òµÃºÜ½áʵµÄ¡£µ«ÊÇÓÉÓÚÌìÐÔϲ»¶×ßÉñ¼Ó·¢´ô£¬´ó°ë¸öѧÆÚ¹ýÈ¥ºó£¬ºöÈ»ÓÐÒ»Ì죬“Á¼ÐÄ·¢ÏÖ”ÔÀ´×Ô¼ºÒѾÂäÏÂÄÇô¶à- -|||£¬ºÇºÇ
ÓÚÊǾö¶¨·ÜÆ𣡣¡£¡
ÔÚͼÊé¹Ý¹äÁËn+1ȦÒÔºó£¬ÖÕÓÚÕÒµ½ÁËÒ»±¾Êé ......