javaÏß³Ì
1.Ï̴߳´½¨µÄÁ½ÖÖ·½Ê½
1£©À©Õ¹ThreadÀà²¢ÖØÐ´public void run()·½·¨
ps£º
¶¨ÒåỊ̈߳º
class myThread extends Thread(){
public void run(){
System.out.println("Just working !");
}
}
ʵÀý»¯£º
myThread t=new myThread();
Æô¶¯£º
t.start();
2£©µ÷ÓôøRunnable±äÔªµÄThread¹¹Ô캯Êý
ps:
¶¨ÒåỊ̈߳º
class myRunnable implements Runnable{
public void run(){
System.out.println("Just working !");
}
}
ʵÀý»¯£º
myRunnable r=new myRunnable();
Thread t=new Thread(r);
Æô¶¯£º
t.start();
2.ThreadÀà³£Ó÷½·¨
1£©ThreadÀàÖг£ÓÃÖØÔØ¹¹Ô캯Êý£º
Thread()
Thread(Runnable target)
Thread(Runnable target,String name)
Thread(String name)
2£©setName() ÉèÖÃÏß³ÌÃû³Æ
getName() »ñµÃÏß³ÌÃû³Æ
sleep() ±£Ö¤µ±Ç°Ïß³ÌÖÁÉÙÔÚÖ¸¶¨µÄ˯Ãßʱ¼äÍ£Ö¹Ö´ÐÐ
yield() ʹµ±Ç°ÔËÐÐÖеÄÏ̻߳ص½¿ÉÔËÐÐ״̬£¬²¢Ê¹ÏàͬÓÅÏȼ¶µÄÏß³ÌÓлú»áÔËÐУ¬µ«²»±£Ö¤
join() ±£Ö¤µ±Ç°Ïß³ÌÍ£Ö¹Ö´ÐУ¬Ö±µ½ËûËù¼ÓÈëµÄÏß³ÌÍê³ÉΪֹ
3£©Ö÷ÒªÏ̷߳½·¨
ObjectÀà ThreadÀà Runnable½Ó¿Ú
wait() start() run()
notify() yield() (¾²Ì¬)
notifyAll() sleep()(¾²Ì¬)
jion()
3.Ïß³Ì״̬Óëת±ä
ÐÂ״̬-->¿ÉÔËÐÐ״̬<-->Ô
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
import java.io.*;
class BigInt
{
int a[];
int len;
BigInt(String str)
{
{
len=str.length();
a=new int[len];
for(int i=0;i<len;i++)
{
this.a[i]=str.charAt(i)-48;
}
&nb ......
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.huadoo.model.Area;
public class Aaaa {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
  ......
ÔÚJAVAƽ̨,ʵÏÖÒì²½µ÷ÓõĽÇÉ«ÓÐÈçÏÂÈý¸ö½ÇÉ«:µ÷ÓÃÕß Ìá»õµ¥ ÕæÊµÊý¾Ý
Ò»¸öµ÷ÓÃÕßÔÚµ÷ÓúÄʱ²Ù×÷,²»ÄÜÁ¢¼´·µ»ØÊý¾Ýʱ,ÏÈ·µ»ØÒ»¸öÌá»õµ¥.È»ºóÔÚ¹ýÒ»¶Ïʱ¼äºóƾÌá»õµ¥À´»ñÈ¡ÕæÕýµÄÊý¾Ý.
È¥µ°¸âµêÂòµ°¸â£¬²»ÐèÒªµÈµ°¸â×ö³öÀ´£¨¼ÙÉèÏÖ×öÒªºÜ³¤Ê±¼ä£©£¬Ö»ÐèÒªÁì¸öÌá»õµ¥¾Í¿ÉÒÔÁË£¨È¥¸É±ðµÄÊÂÇ飩£¬µÈµ½µ°¸â×öºÃÁË£¬ÔÙÄÃÌá»õµ¥ ......
C++ÓëJava»ù±¾Êý¾ÝÀàÐͼ°ËùÕ¼ÓÃÄÚ´æ¿Õ¼ä±È½Ï
----------------C++
----------- ------------Java
----------
(01)bool-------- ......