¹ØÓÚ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
Ïà¹ØÎĵµ£º
ÔçÉÏÆð´²ÓеãÍíÁË£¬µ½Ñ§Ð£µÃʱºò¶¼8£º50ÁË£¬Ò»½ø½ÌÊÒ¿´¼ûÕÅТÏéÀÏʦÔÚ½ÌÊÒÀï¸øͬѧÃǽâ¾öÎÊÌ⣬²»¼ûÁËÀϱϵÄÉíÓ°£¬»¹ÒÔΪ×ß´í½ÌÊÒÁËÄØ£¬°´Àí˵Õâ¸öʱºòÀϱÏÓ¦¸ÃÔçÀ´Á˲ÅÊÇ£¬Ò»ÎʲÅÖªµÀÊDZÏÀÏʦ²¡ÁË,È¥Ò½Ôº¼ì²éÈ¥ÁË£¬Ï£Íû±ÏÀÏʦÄÜÔçµãºÃÆðÀ´£¡
½ñÌìÊÇÕÅÀÏʦ¸øÎÒÃÇÉϿΣ¬ÉîÈëÆÊÎöservlet£¬ÔÚûÀ´´«ÖDz¥¿Í֮ǰ¿´¹ý²»ÉÙÒÔÇ°ÕÅÀ ......
1.ËãÊõÔËËã·û
JavaµÄËãÊõÔËËã·û·ÖΪһԪÔËËã·ûºÍ¶þÔªÔËËã·û¡£Ò»ÔªÔËËã·ûÖ»ÓÐÒ»¸ö²Ù×÷Êý£»¶þÔªÔËËã·ûÓÐÁ½¸ö²Ù×÷Êý£¬ÔËËã·ûλÓÚÁ½¸ö²Ù×÷ÊýÖ®¼ä¡£ËãÊõÔËËã·ûµÄ²Ù×÷Êý±ØÐëÊÇÊýÖµÀàÐÍ¡£
(1)Ò»ÔªÔËËã·û£º
Ò»ÔªÔËËã·ûÓУºÕý£¨+£©¡¢¸º£¨££©¡¢¼Ó1£¨++£©ºÍ¼õ1£¨£££ ......
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyÄêMMÔÂddÈÕ HH:mm:ss");
System.out.println(sdf.format(date));
SimpleDateFormat sdf2 = new SimpleDateFormat("MM");
System.out.println(sdf2.format(date));
Calendar c = Calendar.getInstance();
System.out.println(c.get(C ......
¡¡¡¡»·¾³°²×°ÅäÖÃ
TOMCATµÄÅäÖÃ
JAVAÅäÖÃÎļþ±àд˵Ã÷Îĵµ
Ò»²½Ò»²½Ñ§»áÅäÖÃKjava¿ª·¢»·¾³
......