JavaỊ̈߳ºÏ̵߳ĵ÷¶È ÐÝÃß
JavaÏ̵߳÷¶ÈÊÇJava¶àÏ̵߳ĺËÐÄ£¬Ö»ÓÐÁ¼ºÃµÄµ÷¶È£¬²ÅÄܳä·Ö·¢»ÓϵͳµÄÐÔÄÜ£¬Ìá¸ß³ÌÐòµÄÖ´ÐÐЧÂÊ¡£
ÕâÀïÒªÃ÷È·µÄÒ»µã£¬²»¹Ü³ÌÐòÔ±Ôõô±àдµ÷¶È£¬Ö»ÄÜ×î´óÏ޶ȵÄÓ°ÏìÏß³ÌÖ´ÐеĴÎÐò£¬¶ø²»ÄÜ×öµ½¾«×¼¿ØÖÆ¡£
Ïß³ÌÐÝÃßµÄÄ¿µÄÊÇʹÏß³ÌÈóöCPUµÄ×î¼òµ¥µÄ×ö·¨Ö®Ò»£¬Ïß³ÌÐÝÃßʱºò£¬»á½«CPU×ÊÔ´½»¸øÆäËûỊ̈߳¬ÒÔ±ãÄÜÂÖ»»Ö´ÐУ¬µ±ÐÝÃßÒ»¶¨Ê±¼äºó£¬Ï̻߳áËÕÐÑ£¬½øÈë×¼±¸×´Ì¬µÈ´ýÖ´ÐС£
Ïß³ÌÐÝÃߵķ½·¨ÊÇThread.sleep(long millis) ºÍThread.sleep(long millis, int nanos) £¬¾ùΪ¾²Ì¬·½·¨£¬Äǵ÷ÓÃsleepÐÝÃßµÄÄĸöÏß³ÌÄØ£¿¼òµ¥Ëµ£¬ÄĸöÏ̵߳÷ÓÃsleep£¬¾ÍÐÝÃßÄĸöÏ̡߳£
/**
* JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÐÝÃß
*
* @author leizhimin 2009-11-4 9:02:40
*/
public
class
Test {
public
static
void
main(String[] args) {
Thread t1 = new
MyThread1();
Thread t2 = new
Thread(new
MyRunnable());
t1.start();
t2.start();
}
}
class
MyThread1 extends
Thread {
public
void
run() {
for
(int
i = 0; i < 3; i++) {
System.out.println("Ïß³Ì1µÚ"
+ i + "´ÎÖ´ÐУ¡"
);
try
{
&n
Ïà¹ØÎĵµ£º
ÕâÊÇ·þÎñ´°¿ÚÀ࣬ģÄâËĸöÏß³ÌÒì²½ÔËÐÐ
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 ......
2002Äê£¬ÖøÃûµÄ”Java2ÐéÄâ»úÄÚÄ»”×÷Õß¶ÔJavaÖ®¸¸Õ²Ä·Ë¹·¸ß˹ÁÖ½øÐÐÁË·Ã̸£¬Ì¸»°ÖУ¬¸ß˹ÁÖ¾ÍÈí¼þÉè¼ÆµÄ¸´ÔÓÐÔºÍËã·¨·¢±íÁËËûµÄһЩ¿´·¨¡£¶ÔÓÐÖ¾ÓÚ´ÓÊÂITÈí¼þÐÐÒµµÄͯЬÀ´Ëµ£¬ÌýÌýר¼ÒµÄÒâ¼û£¬Ó¦¸Ã»¹ÊDz»ÎÞñÔÒæµÄ¡£
JavaÖ®¸¸James Gosling
2002Äê3ÔÂ22ÈÕ£¬Bill Venners²É·ÃÁËJavaÖ®¸¸£¬Ì¸ÂÛÁËÓÐ¹ØÆóÒµÈ ......
javaÖÐÒì³£µÄÁ½ÖÖ´¦Àí£º
1.try...catch....finally ´æÔÚÓ뵱ǰµÄÒì³£´¦ÀíÀ࣬±íʾµ±Ç°ÓÉ×Ô¼ºµÄ·½·¨À´´¦Àí
2.Throw ½«µ±Ç°Òì³£Å׳ö £¬½»ÓÉÉϼ¶À´´¦Àí¡£
try...catch....finallyµÄ´¦ÀíÁ÷³Ì£º
½«³öÏÖÒì³£µÄÓï¾ä·ÅÔÚtryÖУ¬Ò»¶Î´ËÓï¾ä³ö´í£¬³ÌÐò»áÔÝÍ£Ö´ÐУ¬Òì³£´¦Àí»úÖÆ¾ÍÈ¥½Ó¹Ü³ÌÐò£¬
½ ......
¡¶Java¾ÍÒµÅàѵ½Ì³Ì¡· ×÷ÕߣºÕÅТÏé ÊéÖÐÔ´Âë
¡¶Java¾ÍÒµÅàѵ½Ì³Ì¡·P34Ô´Âë
³ÌÐòÇåµ¥£ºPromote.java
class Promote
{
public static void main(String args[])
{
byte b = 50;
char c = 'a';
short s = 1024;
int i = 50000;
float ......
SCJP5ѧϰ±Ê¼Ç
Ï߳̽»»¥ÊDZȽϸ´ÔÓµÄÎÊÌ⣬SCJPÒªÇ󲻺ܻù´¡£º¸ø¶¨Ò»¸ö³¡¾°£¬±àд´úÂëÀ´Ç¡µ±Ê¹Óõȴý¡¢Í¨ÖªºÍ֪ͨËùÓÐÏ̡߳£
Ò»¡¢Ï߳̽»»¥µÄ»ù´¡ÖªÊ¶
SCJPËùÒªÇóµÄÏ߳̽»»¥ÖªÊ¶µãÐèÒª´Ójava.lang.Object
µÄÀàµÄÈý¸ö·½·¨À´Ñ§Ï°£º
void notify()
  ......