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

JavaÊý¾Ý±¨±à³ÌÖ®×é²¥


ÔÚÐÅϢʱ´ú£¬ÍøÂç¼¼ÊõÓ¦ÓÃÒѷdz£ÆÕͨ¡£ÆäÖзdz£¶àÓ¦Óö¼ÒÀÀµÓÚ´ÓÒ»¸öÖ÷»úÏò¶à¸öÖ÷»ú»ò´Ó¶à¸öÖ÷»úÏò¶à¸öÖ÷»ú·¢ËÍͬһÐÅÏ¢µÄÄÜÁ¦£¬ÔÚInternetÉÏ·Ö·¢µÄÊýÄ¿¿ÉÄÜ´ïÊýÊ®Íǫ̀£¬ÕâЩ¶¼ÐèÒª¸ü¸ßµÄ´ø¿í£¬²¢ÇÒ´ó´ó³¬³öÁ˵¥²¥µÄÄÜÁ¦¡£Ò»ÖÖÄÜ×î´óÏ޶ȵØÀûÓÃÏÖÓдø¿íµÄÖØÒª¼¼ÊõÊÇIP×é²¥¡£
1£®IP×é²¥¼¼ÊõµÄ¸ÅÄî
IP×é²¥¼¼Êõ£¬ÊÇÒ»ÖÖÔÊÐíһ̨»ò¶ą̀Ö÷»ú£¨×é²¥Ô´£©·¢Ë͵¥Ò»Êý¾Ý°üµ½¶ą̀Ö÷»ú£¨Ò»´ÎµÄ£¬Í¬Ê±µÄ£©µÄTCP/IPÍøÂç¼¼Êõ,ÊÇÒ»µã¶Ô¶àµãµÄͨÐÅ¡£ÔÚÍøÂç¶àýÌå¹ã²¥µÄÓ¦ÓÃÖУ¬µ±ÐèÒª½«Ò»¸ö½ÚµãµÄÐźŴ«Ë͵½¶à¸ö½Úµãʱ£¬ÎÞÂÛÊDzÉÓÃÖظ´µã¶ÔµãͨÐÅ·½Ê½£¬»¹ÊDzÉÓù㲥·½Ê½£¬¶¼»áÑÏÖØÀË·ÑÍøÂç´ø¿í£¬Ö»ÓÐ×é²¥²ÅÊÇ×î¼ÑµÄÑ¡Ôñ¡£×é²¥ÄÜʹһ¸ö»ò¶à¸ö×é²¥Ô´Ö»°ÑÊý¾Ý°ü·¢Ë͸øÌض¨µÄ×é²¥×飬¶øÖ»ÓмÓÈë¸Ã×é²¥×éµÄÖ÷»ú²ÅÄܽÓÊÕµ½Êý¾Ý°ü¡£
2£®IP×é²¥µØÖ·
IP×鲥ͨÐÅÒÀÀµÓÚIP×é²¥µØÖ·£¬ÔÚIPv4ÖÐËûÊǸöDÀàIPµØÖ·£¬·¶Î§´Ó224.0.0.0µ½239.255.255.255£¬²¢±»»®·ÖΪ¾Ö²¿Á´½Ó×é²¥µØÖ·¡¢Ô¤Áô×é²¥µØÖ·ºÍ¹ÜÀíȨÏÞ×é²¥µØÖ·ÈýÀà¡£ÆäÖУ¬¾Ö²¿Á´½Ó×é²¥µØÖ··¶Î§ÔÚ224.0.0.0~224.0.0.255£¬ÕâÊÇΪ·ÓÉЭÒéºÍÆäËûÓÃ;±£ÁôµÄµØÖ·£¬Â·ÓÉÆ÷²¢²»×ª·¢ÊôÓÚ´Ë·¶Î§µÄIP°ü£»Ô¤Áô×é²¥µØַΪ224.0.1.0~238.255.255.255£¬¿ÉÓÃÓÚÈ«Çò·¶Î§£¨Èç Internet£©»òÍøÂçЭÒ飻¹ÜÀíȨÏÞ×é²¥µØַΪ239.0.0.0~239.255.255.255£¬¿É¹©×éÖ¯ÄÚ²¿Ê¹Óã¬ÀàËÆÓÚ˽ÓÐIPµØÖ·£¬²»ÄÜÓÃÓÚInternet£¬¿ÉÏÞÖÆ×é²¥·¶Î§¡£
3£®×é²¥×é
ʹÓÃͬһ¸öIP×é²¥µØÖ·½ÓÊÕ×é²¥Êý¾Ý°üµÄËùÓÐÖ÷»ú¹¹³ÉÁËÒ»¸öÖ÷»ú×飬Ҳ³ÆΪ×é²¥×é¡£Ò»¸ö×é²¥×éµÄ³ÉÔ±ÊÇËæʱ±ä¶¯µÄ£¬Ò»Ì¨Ö÷»úÄÜËæʱ¼ÓÈë»òÀ뿪×é²¥×飬×é²¥×é³ÉÔ±µÄÊýÄ¿ºÍËùÔڵĵØÀíλÖÃÒ²²»ÊÜÏÞÖÆ£¬Ò»Ì¨Ö÷»úÒ²ÄÜÊôÓÚ¼¸¸ö×é²¥×é¡£´ËÍ⣬²»ÊôÓÚijһ¸ö×é²¥×éµÄÖ÷»úÒ²ÄÜÏò¸Ã×é²¥×é·¢ËÍÊý¾Ý°ü¡£
±¾ÎÄʹÓÃMulticastSocketÀàµÄʵÀý±àд×é²¥Ó¦Óã¬MulticastSocketÀàÌṩÁ¬½ÓºÍÀ뿪×é²¥µÈ²Ù×÷¡£
MultiSenderÀàÇåµ¥
package recmail.multiservice;
import java.net.*;
import java.io.IOException;
/**
 * ¸ÃÀà·â×°ÁËMulticastSocketÀà,Íê³ÉÁËMulticastSocketÀàʵÀýµÄ´´½¨¡¢³õʼ»¯¹¦ÄÜ,
 * ²¢ÌṩÁËÒ»¸ö·¢ËÍÊý¾ÝµÄ½Ó¿Ú.
 */
public class MultiSender {
  public static final int MultiSender_Port=4099;
  private MulticastSocket road;
  private InetAddress ia;
  public MultiSender() {
    try {
      //×é²¥


Ïà¹ØÎĵµ£º

JavaÉè¼Æģʽ֮:IteratorÁ´±íģʽ

ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔ­Àí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËغ͸ÃÔªËصĽڵ㡣
public class NodeBean implements Serializable
{
   
    private Object data; //ÔªËر¾Éí
    private NodeBean next; //ÏÂÒ»¸ö½Úµã
   
  &n ......

javaѧϰ·½·¨×ܽá

Èç¹ûÄãjavaÒѾ­ÈëÃÅÁË£¬½¨ÒéÄãÏȲ»È¥Ïë´úÂë¡£¶øÊÇÈ¥ÏëÍê³ÉÈÎÎñÒª×öµÄ²½Öè¡£ÏëºÃÁ˺óÄÄÅÂÄãÈ¥Õ³Ìù´úÂ붼¿ÉÒÔ¡£±à³ÌÊÇ¿¼ÑéµÄ˼ά£¬²»ÊÇд´úÂëµÄËٶȣ¬ºÍ¶Ô´úÂëµÄ¼ÇÒäÐÔ¡£
±à³ÌÊÇÒ»¼þ¾­Ñé»î, ²»ÊÇ¿´ÊéÄܽâ¾öµÄ, ±à³ÌÖÐÓöµ½µÄÎÊÌâǧÆæ°Ù¹Ö, ¸ù±¾²»ÊÇÒ»±¾Êé»òÕßn±¾ÄܸøÄã½â¾öµÄ£¬±ØÐë×Ô¼ºÇ××ÔÈ¥Ìå»á
 
ËùÒÔ, ÕÒ±¾ÓÐʵÀýµ ......

java¼Ü¹¹Ê¦ËùÐèÒªµÄ֪ʶ

Ñ¡ÔñµÄ·¶Î§Ì«¹ã£¬¿ÉÒÔ¶ÁµÄÊéÌ«¶à£¬ÍùÍùÈÝÒ×ÎÞËùÊÊ´Ó¡£ÎÒÏë¾ÍÎÒ×Ô¼º¶Á¹ýµÄ¼¼ÊõÊé¼®ÖÐÌôÑ¡³öÀ´Ò»Ð©£¬°´ÕÕѧϰµÄÏȺó˳Ðò£¬ÍƼö¸ø´ó¼Ò£¬ÌرðÊÇÄÇЩÏë²»¶ÏÌá¸ß×Ô¼º¼¼ÊõˮƽµÄJava³ÌÐòÔ±ÃÇ¡£
Ò»¡¢Java±à³ÌÈëÃÅÀà
¶ÔÓÚûÓÐJava±à³Ì¾­ÑéµÄ³ÌÐòÔ±ÒªÈëÃÅ£¬Ëæ±ã¶ÁʲôÈëÃÅÊé¼®¶¼Ò»Ñù£¬Õâ¸ö½×¶ÎÐèÒªÄã¿ìËÙµÄÕÆÎÕJava»ù´¡Óï·¨ºÍ»ù±¾Óà ......

[ת]Does Java pass by reference or pass by value?

http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html
Does Java pass by reference or pass by value?
Why can't you swap in Java?
By Tony
Sintes, JavaWorld.com, 05/26/00

Print
Email
Feedback
Resources
Discuss
(76)
Digg
Reddit
SlashDot
Stumble
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ