Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaλÔËËãÀý×Ó

/*
Ò»¹²3¸öÒÆλÔËËã·û£¬×óÒÆλ<<£¬ÓÒÒÆλ>>ºÍÎÞ·ûºÅÒÆλ>>>¡£×óÒÆλ<<ÔÚµÍλ´¦²¹0¡£ÓÒÒÆλ>>ÈôֵΪÕýÔòÔÚ¸ßλ²åÈë0£¬ÈôֵΪ¸ºÔòÔÚ¸ßλ²åÈë1¡£ÎÞ·ûºÅÓÒÒÆλ>>>ÎÞÂÛÕý¸º¶¼ÔÚ¸ßλ´¦²åÈë0¡£
·ÇÔËËã·û~
&¶ÔÁ½¸öÕûÐͲÙ×÷ÊýÖжÔӦλִÐв¼¶û´úÊý£¬Á½¸öλ¶¼Îª1ʱÊä³ö1£¬·ñÔò0¡£
^¶ÔÁ½¸öÕûÐͲÙ×÷ÊýÖжÔӦλִÐв¼¶û´úÊý£¬Á½¸öλÏàµÈ0£¬²»µÈ1¡£
|¶ÔÁ½¸öÕûÐͲÙ×÷ÊýÖжÔӦλִÐв¼¶û´úÊý£¬Á½¸öλ¶¼Îª0ʱÊä³ö0£¬·ñÔò1¡£
*/
public class weiyunsuan {
public static void main(String[] args) {
int a=-6;// 1111 1111 1111 1111 1111 1111 1111 1010
int b=3;// 0000 0000 0000 0000 0000 0000 0000 0011
int c=6; // 0000 0000 0000 0000 0000 0000 0000 0110
zuoyi(a, b);//-48 1111 1111 1111 1111 1111 1111 1101 0000
youyi(a, b);//-1 1111 1111 1111 1111 1111 1111 1111 1111
wufuhaoyouyi(a, b);//0001 1111 1111 1111 1111 1111 1111 1111
zuoyi(c, b);//48 0000 0000 0000 0000 0000 0000 0011 0000
youyi(c, b);//0 0000 0000 0000 0000 0000 0000 0000 0000
wufuhaoyouyi(c, b);//0000 0000 0000 0000 0000 0000 0000 0000
yu(a, b);//2 0000 0000 0000 0000 0000 0000 0000 0010
huo(a, b);//-5 1111 1111 1111 1111 1111 1111 1111 1011
fei(a);//5 0000 0000 0000 0000 0000 0000 0000 0101
yihuo(a, b);//-7 1111 1111 1111 1111 1111 1111 1111 1001
}
public static void zuoyi(int a,int b){
System.out.println(a<<b);
}
public static void youyi(int a,int b){
System.out.println(a>>b);
}
public static void wufuhaoyouyi(int a,int b){
System.out.println(a>>>b);
}
public static void yu(int a,int b){
System.out.println(a&b);
}
public static void huo(int a,int b){
System.out.println(a|b);
}
public static void fei(int a){
System.out.println(~a);
}
public static void yihuo(int a,int b){


Ïà¹ØÎĵµ£º

javaÈëÃÅ

 Javaѧϰ´ÓÈëÃŵ½¾«Í¨ 
Ò»¡¢ JDK (Java Development Kit) 
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......

¶à´°¿ÚÒì²½ÊÛƱjava¾À´í

ÕâÊÇ·þÎñ´°¿ÚÀ࣬ģÄâËĸöÏß³ÌÒì²½ÔËÐÐ
public class TicketWindow {
 public static void main(String args[]) {
  Ticket ticket = new Ticket();
  Thread w1 = new Thread(ticket, "1ºÅÊÛƱ´°¿Ú");
  Thread w2 = new Thread(ticket, "2ºÅÊÛƱ´°¿Ú");
  Thread w3 ......

try...catch...finally java String µÄÓ÷¨

javaÖÐÒì³£µÄÁ½ÖÖ´¦Àí£º
1.try...catch....finally ´æÔÚÓ뵱ǰµÄÒì³£´¦ÀíÀ࣬±íʾµ±Ç°ÓÉ×Ô¼ºµÄ·½·¨À´´¦Àí
2.Throw ½«µ±Ç°Òì³£Å׳ö £¬½»ÓÉÉϼ¶À´´¦Àí¡£
 try...catch....finallyµÄ´¦ÀíÁ÷³Ì£º
   ½«³öÏÖÒì³£µÄÓï¾ä·ÅÔÚtryÖУ¬Ò»¶Î´ËÓï¾ä³ö´í£¬³ÌÐò»áÔÝÍ£Ö´ÐУ¬Òì³£´¦Àí»úÖƾÍÈ¥½Ó¹Ü³ÌÐò£¬
   ½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ