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

Java SE ¶àÏß³Ì Ïß³ÌͨÐÅ

package thread;
class QQ{
 private String name;
 private String sex;
 boolean flag=false;
 public synchronized void put(String name,String sex){
  if(flag)
   try {
    wait();
   } catch (InterruptedException e1) {
    e1.printStackTrace();
   }
  this.name=name;
  try {
   Thread.sleep(10);
  } catch (InterruptedException e) {
   e.printStackTrace();
  }
  this.sex=sex;
  flag=true;
  notify();
 }
 public synchronized void get(){
  if(!flag)
   try {
    wait();
   } catch (InterruptedException e) {
    e.printStackTrace();
   }
  System.out.println(name +"----------->"+sex);
  flag=false;
  notify();
 }
}
class Producer1 implements Runnable{
 QQ qq=null;
 public Producer1(QQ qq){
  this.qq=qq;
 }
 public void run() {
  int i=0;
  while(true){
   if(i==0){
    qq.put("zxx", "nan");
   }else{
    qq.put("cq", "nv");
   }
    i=(i+1)%2;
  }
 }
 
}
class Consumer1 implements Runnable{
 QQ qq=null;
 public Consumer1(QQ qq){
  this.qq=qq;
 }
 public void run() {
  while(true){
   qq.get();
  }
 }
 
}
public class ThreadCommunciation {
 public static void main(String[] args) {
  QQ qq=new QQ();
  new Thread(new Producer1(qq )).start();
  new Thread(new Consumer1(qq)).start();
 }
}


Ïà¹ØÎĵµ£º

JavaÖÐ×Ö·û´®±È½ÏµÄ×¢Òâµã

ÊìϤC++µÄÈ˶ÔÓÚÁ½¸ö×Ö·û´®±È½ÏµÄ´úÂëÒ»¶¨ºÜÁ˽⣺
(string1==string2)
µ«ÔÚjavaÖУ¬Õâ¸ö´úÂ뼴ʹÔÚÁ½¸ö×Ö·û´®ÍêÈ«ÏàͬµÄÇé¿öÏÂÒ²»á·µ»Øfalse
JavaÖбØÐëʹÓÃstring1.equals(string2)À´½øÐÐÅжÏ
²¹³ä
Èç¹û£º
string s1=new String("Hello");
string s2=new String("Hello");
Ôò(s1==s2)=false
Èç¹û£º
s ......

FlexºÍJava½»»¥µÄÂÒÂë½â¾ö·½°¸


½ñÌì×öFlexʱÅöµ½flexºÍjava½»»¥µÄÂÒÂëÎÊÌ⣬ʹÓÃHTTPServiceÎÞÂÛÊÇ´ÓFlex¶Ë´«µ½Java¶Ë£¬»¹ÊÇ·´¹ýÀ´¶¼ÂÒÂë¡£µ÷²éÁË°ëÌ죬ÖÕÓڸ㶨ÁË¡£
 
 
ÒÔÏÂÊǽâ¾ö·½°¸£º
 
 
1.Flex¶Ë´«µ½Java¶Ë
 
Flex¶Ë:encodeURIComponent(comment.text)
ʹÓÃencodeURIComponent°Ñ²ÎÊýת»»Îª application/x-www ......

Java WebÓ¦ÓÃÔÚARM Linuxƽ̨ÉϵÄʵÏÖ


0
Java WebÓ¦ÓÃÔÚARM Linuxƽ̨ÉϵÄʵÏÖ
Posted in ˶²©ÂÛÎÄ at ʮһÔ 12th, 2009 / No Comments »
Íõ࣬ÖÜÀ¼½­£¬ÁõÀñ¶«£¬½âÔÆÏö
(À¥Ã÷Àí¹¤´óѧÐÅÏ¢¹¤³ÌÓë×Ô¶¯»¯Ñ§Ôº£¬ÔÆÄÏÀ¥Ã÷650051)
1ÒýÑÔ
Ëæ×ÅÍøÂçÐÅÏ¢¼¼ÊõµÄ·ÉËÙ·¢Õ¹£¬Web¼¼ÊõÔ½À´Ô½¶àµÄÓÃÔÚ¿ØÖÆÁìÓò£¬¿Í»§¶ËÖ»ÐèÁ¬½ÓÒÔÌ«Íø£¬È¡µÃ·ÃÎÊȨÏÞ£¬¾Í¿ÉÒÔ·Ã ......

JavaÖÐʹÓÃBigDecimalʵÏÖ¾«È·ÉáÎåÈë¼°¹¤³ÌÔËËã

£¨×¢£ºÇ°ÃæдÁËÒ»¸ö³¬´óÕûÊýÏà¼ÓµÄÀ࣬²Î¼û£º ³¬´óÕûÊýÏà¼Ó£¬³¬¹ýÁËlongµÄ·¶Î§£¬ÄãÒªÔõô×ö£¡£¬ºóÀ´ÓÐÅóÓÑÆÀÂÛ˵BigDecimal¿ÉÒÔÍêȫʵÏÖÎÒµÄÕâÕâ¸ö¹¦ÄÜ£¬¸Õ¿ªÊ¼µÄʱºò£¬ÎÒ»¹²»·þÆø£¬¾ÝÎÒËùÖªÄÇÀïÓÐÕâÑùµÄÀàŶ£¬ºóÀ´±¨×Å˵·þËûµÄÐÄÀíÈ¥ÕÒÁËһϣ¬ºÇºÇ£¬½á¹û¾ÓÈ»×Ô¼º±»Ëµ·þÁË£¬È·ÊµÓÐÕâôһ»ØÊ£¬ÀûÓÃBigDecimal²Ù×÷³¬´óÕûÊýÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ