JavaÖзÓÉÆ÷ģʽ
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.io.Serializable;
import java.rmi.Naming;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.HashMap;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
public class RunRouterPattern {
public static void main(String[] arguments) {
System.out.println("Example for the Router pattern");
System.out
.println("This code same will create a series of GUIs, and use");
System.out
.println(" the Router pattern to map message notifications between");
System.out
.println(" them. In this code example, the Router will send messages");
System.out
.println(" between the GUI clients based on the following mapping:");
System.out.println();
System.out.println("\tGUI # 1:\tGUI #2\tGUI #3");
System.out.println("\tGUI # 2:\tGUI #1\tGUI&nbs
Ïà¹ØÎĵµ£º
ÔÚJavaÖУ¬“Ïָ߳̔Á½¼þ²»Í¬µÄÊÂÇ飺
1¡¢java.lang.ThreadÀàµÄÒ»¸öʵÀý£»
2¡¢Ï̵߳ÄÖ´ÐС£
ʹÓÃjava.lang.ThreadÀà»òÕßjava.lang.Runnable½Ó¿Ú±àд´úÂëÀ´¶¨Ò塢ʵÀý»¯ºÍÆô¶¯ÐÂÏ̡߳£
Ò»¸öThreadÀàʵÀýÖ»ÊÇÒ»¸ö¶ÔÏó£¬ÏñJavaÖеÄÈκÎÆäËû¶ÔÏóÒ»Ñù£¬¾ßÓбäÁ¿ºÍ·½·¨£¬ÉúËÀÓÚ¶ÑÉÏ¡£
JavaÖУ¬Ã¿¸öÏ̶߳¼ÓÐÒ»¸öµ÷ ......
ÒÔÏÂÊÇ Java ÅжÏ×Ö·û´®ÊÇ·ñΪ¿ÕµÄÈýÖÖ·½·¨.
·½·¨Ò»: ×î¶àÈËʹÓõÄÒ»¸ö·½·¨, Ö±¹Û, ·½±ã, µ«Ð§ÂʺܵÍ.
·½·¨¶þ: ±È½Ï×Ö·û´®³¤¶È, ЧÂʸß, ÊÇÎÒÖªµÀµÄ×îºÃÒ»¸ö·½·¨.
·½·¨Èý: Java SE 6.0 ²Å¿ªÊ¼ÌṩµÄ·½·¨, ЧÂʺͷ½·¨¶þ¼¸ºõÏàµÈ, µ«³öÓÚ¼æÈÝÐÔ¿¼ÂÇ, ÍƼöʹÓ÷½·¨¶þ.
ÒÔÏ´úÂëÔÚÎÒ»úÆ÷ÉϵÄÔËÐнá¹û: (»úÆ÷ÐÔÄܲ»Ò», ½ö¹ ......
javaÖжÑÕ»(stack)ºÍ¶Ñ(heap)
Ò»¡¢¶ÑÕ»(stack)ºÍ¶Ñ(heap)£¿
£¨£±£©ÄÚ´æ·ÖÅäµÄ²ßÂÔ
¡¡¡¡°´ÕÕ±àÒëÔÀíµÄ¹Ûµã,³ÌÐòÔËÐÐʱµÄÄÚ´æ·ÖÅäÓÐÈýÖÖ²ßÂÔ,·Ö±ðÊǾ²Ì¬µÄ,ջʽµÄ,ºÍ¶ÑʽµÄ.
¡¡¾²Ì¬´æ´¢·ÖÅäÊÇÖ¸ÔÚ±àÒëʱ¾ÍÄÜÈ·¶¨Ã¿¸öÊý¾ÝÄ¿±êÔÚÔËÐÐʱ¿ÌµÄ´æ´¢¿Õ¼äÐèÇó,Òò¶øÔÚ±àÒëʱ¾Í¿ÉÒÔ¸øËûÃÇ·ÖÅä¹Ì¶¨µÄÄ ......
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
ѧϰǰÁ˽â
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJDKÊÇSun¹«Ë¾·¢²¼µÄJDK£¬³ýÁËSunÖ®Í⣠......
Õ⼸Ì죬ÔÚÍøÉÏËÑÁ˺ܶà¹ØÓÚjavaµÄ¶«Î÷£¬ÏÖÔÚ¸ø´ó¼Ò×ܽáһϣ¬·Ç³£ÓÐÓÃŶ£¬ºÜ¶à¶«Î÷ÎÒÃÇÔÚ¹úÄÚÊÇÎÞ·¨Á˽⵽µÄ
java³ÌÐòÔ±±ØÈ¥µÄ¹úÍâÍøÕ¾
http://www.onjava.com
ÿÖܶ¼ÓÐÐÂÎÄÕ·¢±í
http://www.developer.com/java
ÓÉGamelan.com ά»¤µÄJava¼¼ÊõÎÄÕÂÍøÕ¾
http://www.java.net
Sun¹«Ë¾Î¬»¤µÄÒ»¸öJavaÉçÇøÍøÕ¾
http:/ ......