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

JavaÓëActionScriptµÄSocket(1)

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cn.vicky.socket;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.Vector;
/**
*
* @author Vicky
* ¹ã²¥Àà
*/
public class BManager extends Vector<Socket> {
/**
* ¶ÔËùÓÐÒѾ­Á¬½ÓÉϵÄsocket·¢ËÍÏûÏ¢
* @param msg
* @throws IOException
*/
public synchronized void sendToAll(String msg) throws IOException {
Socket socket = null;
PrintWriter writer = null;
for (int i = 0; i < size(); i++) {
socket = get(i);
if (socket != null) {
writer = new PrintWriter(socket.getOutputStream(),true);
if (writer != null) {
writer.println(msg);
}
}
}
}
/**
* Ïòij¸öÈË·¢ËÍÏûÏ¢
* @param msg
* @param socket
* @throws IOException
*/
public synchronized void sendToOne(String msg, Socket socket) throws IOException {
PrintWriter writer = null;
if (socket != null && contains(socket)) {
writer = new PrintWriter(socket.getOutputStream(),true);
if (writer != null) {
writer.println(msg);
}
}
}
/**
* ÏòËùÓÐÈË·¢Ë͵±Ç°ÔÚÏßÈËÊý
* @throws IOException
*/
public synchronized void sendInfo() throws IOException {
String msg = "µ±Ç°ÈËÊý:" + size() + "ÈË";
sendToAll(msg);
}
}

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cn.vicky.socket;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Vicky
* ÁÄÌìϵͳ·þÎñÆ÷
*/
public class ChatServer {
private static final Logger logger


Ïà¹ØÎĵµ£º

JavaÖм¯ºÏÈÝÆ÷ÀàListºÍSetµÄÓ÷¨

ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1  List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......

javaÐòÁл¯(Serializable)µÄ×÷Óúͷ´ÐòÁл¯

ÕâÀïתÔØһƪ½²½âjavaÐòÁл¯(Serializable)ºÍ·´ÐòÁл¯·½ÃæµÄ¸Ð¾õºÜºÃµÄÎÄÕ¡£
1¡¢ÐòÁл¯ÊǸÉʲôµÄ£¿
¼òµ¥Ëµ¾ÍÊÇΪÁ˱£´æÔÚÄÚ´æÖеĸ÷ÖÖ¶ÔÏóµÄ״̬£¨Ò²¾ÍÊÇʵÀý±äÁ¿£¬²»ÊÇ·½·¨£©£¬²¢ÇÒ¿ÉÒ԰ѱ£´æµÄ¶ÔÏó״̬ÔÙ¶Á³öÀ´¡£ËäÈ»Äã¿ÉÒÔÓÃÄã×Ô¼ºµÄ¸÷ÖÖ¸÷ÑùµÄ·½·¨À´±£ ´æobject states£¬µ«ÊÇJava¸øÄãÌṩһÖÖÓ¦¸Ã±ÈÄã×Ô¼ººÃµÄ±£´æ ......

Javaѧϰ·Ïßͼ


JAVAѧϰ·Ïßͼ
ÔÚ¿ªÊ¼Ö®Ç°ÓбØÒªÔÙÌÖÂÛÒ»ÏÂJ2ME£¬J2SE£¬J2EEÕâЩ¸ÅÄî¡£J2ME£¬The
Micro Edition of the Java 2 Platform¡£Ö÷ÒªÓÃÓÚǶÈëʽJava£¬ÈçÊÖ»ú£¬PDAµÈµÈ¡£J2SE£¬Java 2
Platform£¬Standard Edition£¬ÎÒÃÇͨ³£Ëù˵µÄJDK(Java Development
Kit)°üº¬ÔÚ´Ë£¬ÊÇJ2EEµÄ»ù´¡¡£J2EE£¬Java 2 Platform£¬Enterprise ......

Âþ̸£ºÑ¡ÔñJava Web¿ª·¢Õæ²»ÈÝÒ×

ƽʱÔÚ¹¤×÷µÄʱºò£¬×ÜÊǾõµÃ¸Õ±ÏÒµµÄͬÊÂÃǶԼ¼ÊõµÄÀí½â²»µ½Î»£¬ÖªÆäÈ»¶ø²»ÖªÆäËùÒÔÈ»¡£¿ÉÊÇ£¬¾²ÏÂÐÄÀ´ÏëÒ»Ï룬ÕâÒ²²»ÄÜÈ«¹ÖËûÃÇ£¬²»ÊÇÐÂÈËÃDz»°®
ѧ£¬¶øÊÇÏÖÈç½ñJava Web¿ª·¢µÄÈ·ºÜ·±¸´¡£±íÃæÉÏ¿´£¬ÏÖÔÚ»áJavaµÄÈ˶àÈçţ룬SSH ºÞ²»µÃÊÇÿ¸ö java ¿ª·¢Åàѵ¿ÎµÄ±ØÑ¡ÏîÄ¿£¬µ«
WEB ¿ª·¢µÄÃż÷£¬ÕæµÄ²»µÍ¡£µ±È»£¬ÎÒ˵²»µÍ£ ......

OSGiÊÇʲô£ºJavaÓïÑԵĶ¯Ì¬Ä£¿éϵͳ

֮ǰ51CTOÔø·¢¹ýһƪÎÄÕ½Ð×ö¡¶OSGiΪʲôÖØÒª£ºÏòÄ£¿é»¯×ªÒƵÄÖ÷¹¥ÊÖ
¡·£¬ÀïÃæ¶ÔÓÚOSGiµÄÓÅÊƽøÐÐÁË·ÖÎö¡£²»¹ý£¬¶ÔÓÚ
¾¿¾¹Ê²Ã´ÊÇOSGi£¬ºÜ¶àÈËÈÔȻֻÓÐÒ»¸öÄ£ºýµÄ¸ÅÄî¡£±¾ÏµÁУ¨ÄãºÃ£¬OSGi
£©´Ó»ù´¡¿ª
ʼ½éÉÜÁËOSGi¡£±¾²¿·Ö½éÉÜOSGiÊÇʲô£¬ÒÔ¼°OSGiÈÝÆ÷µÄһЩÏÖ×´¡££¨×¢£º±¾ÎÄÓ¢ÎÄÔ­ÎÄÓÚ08Äê3Ô·¢²¼ÔÚJavaWorldÍøÕ¾£© ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ