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

JAVA »ñµÃIPµØÖ·

1. java »ñÈ¡ipµØÖ·µÄ´úÂë
    String loacalIp = "";
    try
   {
       InetAddress localhost = InetAddress.getLocalHost();
        loacalIp  =localhost.getHostAddress();
       //System.out.println("localhost: "+localhost.getHostAddress());
       //System.out.println("localhost: "+localhost.getHostName());
   }
       catch(UnknownHostException uhe)
   {
     System.err.println("Localhost Ip exception " + uhe.toString());
   }
  A£º´Ë´úÂëÔÚwindows ÏÂÃæ»ñÈ¡ipµØÖ·ÊÇÍêÈ«ÕýÈ·¡£
  B£º´Ë´úÂëÔÚlinuxÏÂÃæÈ¡µÃµÄipµØÖ·×ÜÊÇ:127.0.0.1
2.ΪÁË»ñÈ¡linuxÏÂÃæÕýÈ·µÄipµØÖ·
   ÐÞ¸ÄetcÏÂÃæµÄhostsÎļþ
   ***.***.***.***     localhost.localdomain   localhost
   ÐÞ¸ÄΪ±¾»úµÄipµØÖ·£¬¶ø²»ÊÇ127.0.0.1
   ¾ßÌåÐ޸ĵķ½·¨£¬µ±È»ÊÇÓÃvi½øÐб༭¡£±£´æºó²»ÓÃÖØÆô»úÆ÷£¬¼´¿É¡£


Ïà¹ØÎĵµ£º

Java NIO APIÏê½â

 
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......

ÓÃjavaÓïÑÔ ±àдµÄ³Ë·¨¿Ú¾÷±í

 public class Test {
 public static void main(String args[]) {
  int i;
  int j;
  for (i = 1; i <= 9; i++) {
   for (j = 1; j <= i; j++) {
    if (j * i <= 9)
     System.out.print(j ......

javaµ÷Óô洢¹ý³Ì£¨jdbc & hibernate£©

Ò»¡¢JDBCµ÷Óô洢¹ý³Ì
creat proc proc_select
¡¡¡¡@pid varchar(20)
¡¡¡¡@address varchar(20) output
¡¡¡¡as
¡¡¡¡select @address=address from userinfo where pid=@pid
¡¡¡¡go
¡¡¡¡ÓÃjavaµ÷ÓÃ:
¡¡¡¡class.forName(\"sun.jdbc.odbc.JdbcOdbcDriver\"); //¼ÓÔØÇý¶¯
¡¡¡¡Connection con=DriverManager.ge ......

Java SE 5·þÎñÖÜÆÚÒÑÖÕ½á

 ×ª×ÔInfoQ£¬×÷Õß Charles Humble ÒëÕß ÕÅÁú
±¾ÔÂ3ÈÕSunµÄJ2SE 5.0ʵÏÖÒÑÖÕ½á·þÎñÖÜÆÚ£¨End of Service Life£¬¼´EOSL£©£¬ÕâÒ»ÌìÒ²ÊÇ×îºóµÄÒ»´Î5.0¸üз¢²¼ÈÕÆÚ£¨J2SE 5.0 Update 22£©¡£Ñ°ÇóSunÖ§³ÖµÄÓû§¿ÉÒÔÑ¡ÔñÉý¼¶µ½Java 6»òÊǶ©ÔÄSunµÄJava for Business³ÌÐò¡£
SunÌṩÁ˶àÖÖ¶àÑùµÄJava¸¶·ÑÖ§³Ö¡£Java¾­µäÖ§³Ö£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ