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

javaÖÐ×Ö·û´®¶ÔÏóµÄ´´½¨¸öÊý

s = new String("xyz");´´½¨Á˼¸¸öString Object?Á½¸ö¶ÔÏó¡£
String s="ÄãºÃ";int i=3; s=i+s; Õâ¸ö±í´ïʽ¶ÔÂð?ÔÚjavaÖлáÌáʾÊý¾ÝÀàÐͲ»Æ¥Åä¡£ÒòΪstringÊÇÀà!ÕýÈ·×ö·¨: s+="3" »òÕß s+='3'»òÕß s+=(char)i;
ÎÒÃÇÒªÒýÈëÁíÍâÒ»ÖÖ´´½¨String¶ÔÏóµÄ·½Ê½µÄÌÖÂÛ——ÒýºÅÄÚ°üº¬Îı¾¡£ÕâÖÖ·½Ê½ÊÇStringÌØÓеģ¬²¢ÇÒËüÓënewµÄ·½Ê½´æÔںܴóÇø±ð¡£
ÔÚJAVAÐéÄâ»ú£¨JVM£©ÖдæÔÚ×ÅÒ»¸ö×Ö·û´®³Ø£¬ÆäÖб£´æןܶàString¶ÔÏ󣬲¢ÇÒ¿ÉÒÔ±»¹²ÏíʹÓã¬Òò´ËËüÌá¸ßÁËЧÂÊ¡£String a="abc";£¬ÕâÐдúÂë±»Ö´ÐеÄʱºò£¬JAVAÐéÄâ»úÊ×ÏÈÔÚ×Ö·û´®³ØÖвéÕÒÊÇ·ñÒѾ­´æÔÚÁËֵΪ"abc"µÄÕâôһ¸ö¶ÔÏó£¬ÅжÏÒÀ¾ÝÊÇStringÀàequals(Object obj)·½·¨µÄ·µ»ØÖµ¡£Èç¹ûÓУ¬Ôò²»ÔÙ´´½¨ÐµĶÔÏó£¬Ö±½Ó·µ»ØÒÑ´æÔÚ¶ÔÏóµÄÒýÓã»Èç¹ûûÓУ¬ÔòÏÈ´´½¨Õâ¸ö¶ÔÏó£¬È»ºó°ÑËü¼ÓÈëµ½×Ö·û´®³ØÖУ¬ÔÙ½«ËüµÄÒýÓ÷µ»Ø¡£
×Ö·û´®¶ÔÏóµÄ´´½¨:ÓÉÓÚ×Ö·û´®¶ÔÏóµÄ´óÁ¿Ê¹ÓÃ[ËüÊÇÒ»¸ö¶ÔÏó£¬Ò»°ã¶øÑÔ¶ÔÏó×ÜÊÇÔÚheap·ÖÅäÄÚ´æ]£¬JavaÖÐΪÁ˽ÚÊ¡ÄÚ´æ¿Õ¼äºÍÔËÐÐʱ¼ä[Èç±È½Ï×Ö·û´®Ê±£¬==±Èequals()¿ì]£¬ÔÚ±àÒë½×¶Î¾Í°ÑËùÓеÄ×Ö·û´®ÎÄ×ַŵ½Ò»¸öÎÄ×Ö³ØÖУ¬¶øÔËÐÐʱÎÄ×ֳسÉΪ³£Á¿³ØµÄÒ»²¿·Ö¡£ÎÄ×ֳصĺô¦£¬¾ÍÊǸóØÖÐËùÓÐÏàͬµÄ×Ö·û´®³£Á¿±»ºÏ²¢£¬Ö»Õ¼ÓÃÒ»¸ö¿Õ¼ä¡£ÎÒÃÇÖªµÀ£¬¶ÔÁ½¸öÒýÓñäÁ¿£¬Ê¹ÓÃ==ÅжÏËüÃǵÄÖµ[ÒýÓÃ]ÊÇ·ñÏàµÈ£¬¼´Ö¸Ïòͬһ¸ö¶ÔÏó£º
    ÏÖÔÚ¿´String s = new String("abc");Óï¾ä£¬ÕâÀï"abc"±¾Éí¾ÍÊÇpoolÖеÄÒ»¸ö¶ÔÏ󣬶øÔÚÔËÐÐʱִÐÐnew String()ʱ£¬½«poolÖеĶÔÏó¸´ÖÆÒ»·Ý·Åµ½heapÖУ¬²¢ÇÒ°ÑheapÖеÄÕâ¸ö¶ÔÏóµÄÒýÓý»¸øs³ÖÓС£ok£¬ÕâÌõÓï¾ä¾Í´´½¨ÁË2¸öString¶ÔÏó¡£
    String s1 = new String("abc") ;String s2 = new String("abc") ;if( s1 == s2 ){ //²»»áÖ´ÐеÄÓï¾ä}
    //´´½¨Á˼¸¸öString Object? [Èý¸ö£¬poolÖÐÒ»¸ö£¬heapÖÐ2¸ö¡£]
Ö»ÓÐʹÓÃÒýºÅ°üº¬Îı¾µÄ·½Ê½´´½¨µÄString¶ÔÏóÖ®¼äʹÓÓ+”Á¬½Ó²úÉúµÄжÔÏó²Å»á±»¼ÓÈë×Ö·û´®³ØÖС£¶ÔÓÚËùÓаüº¬new·½Ê½Ð½¨¶ÔÏ󣨰üÀ¨null£©µÄ“+”Á¬½Ó±í´ïʽ£¬ËüËù²úÉúµÄжÔÏ󶼲»»á±»¼ÓÈë×Ö·û´®³ØÖС£
1.==±íʾÒýÓÃ×Ôͬһ¶ÔÏó£¬equals£¨£©±íʾֵÏàµÈ¡£
String str1 = "abc";ÒýÓõĶÔÏóÔÚÕ»£¨»òÕß½ÐString³Ø£©ÖС£
String str1 =new String ("abc"); ÒýÓõĶÔÏóÔÚÄÚ´æ/¶ÑÖС£
2.String str1 =  "string";ÔÚÕ»ÖÐ
  String str3 =  "str";ÔÚÕ»ÖÐ
&nbs


Ïà¹ØÎĵµ£º

java¶Áдɾ.text,.xmlÎļþÄÚÈÝ

package fileIo;  
 
import  java.io.BufferedReader;  
import  java.io.BufferedWriter;  
import  java.io.File;  
import  java.io.FileReader;  
import  java.io.FileWriter;  
 
 public&nb ......

java ³ÌÐò ´ò°ü ÔËÐÐ


java´ò°ü-exeÎļþ-×îÖÕÒÔsetupÐÎʽ·¢²¼µÄ½â¾öÖ®µÀ
java´ò°ü-exeÎļþ-×îÖÕÒÔsetupÐÎʽ·¢²¼µÄ½â¾öÖ®µÀ   
Ê×ÏÈ£¬½«±àÒëºÃµÄ³ÌÐò´ò°ü³ÉjarÎļþ£¬È»ºó×ö³öexe£¬ÕâÑù´úÂë¾Í²»¿É¼ûÁË£»µ«ÊÇexeÎļþÔÚûÓа²×°jreµÄµçÄÔÉϲ»ÄÜÔËÐУ¬Èç¹ûÒªÇó¿Í»§ÔÙÈ¥°²×°jre ÉèÖû·¾³±äÁ¿ ¾Í²»ÑÅÁË¡£ÎÒÃÇÐèÒª½«jre´ò°ü¡£
Õ⼸²½²Ù×÷Í ......

¹ØÓÚjavaµÄ¼¯ºÏÀà,ÒÔ¼°HashMapÖÐSetµÄÓ÷¨!


¹ØÓÚjavaµÄ¼¯ºÏÀà,ÒÔ¼°HashMapÖÐSetµÄÓ÷¨!
2005-10-22 14:47:43 Sat | ÔĶÁ£¨547£©´Î
package com.tiantian;
import java.util.*;
public class JAVAContainer {
     public static void main(String[] args) throws Exception {
         //&nbs ......

JAVAµ÷DLL,.JNI¼¼Êõʵ¼ù

¼øÓÚÅÀ³æ¿ª·¢ÐèÒªÒ»¸öͼƬ½âÎö¹¦Äܵĺ¯Êý£¬µ½ÍøÂçÉϲéÕÒÁËһЩjni·½ÃæµÄÄÚÈÝ£¬²¢×öÁË×Ô¼ºµÄһЩÐ޸ģ¬¾ßÌåÈçÏ£º
   Ä¿Ç°javaÓëdll½»»¥µÄ¼¼ÊõÖ÷ÒªÓÐ3ÖÖ£ºjni£¬jawinºÍjacob¡£Jni£¨Java Native Interface£©ÊÇsunÌṩµÄjavaÓëϵͳÖеÄÔ­Éú·½·¨½»»¥µÄ¼¼Êõ£¨ÔÚwindows\linuxϵͳÖУ¬ÊµÏÖjavaÓënative method»¥µ÷£©¡£ ......

һλ»ÝÆÕjavaÑз¢¹¤³Ìʦ²ûÊöjavaÅàѵµÄ¸ÐÑÔ

¹¤×÷ÒѾ­ÓаëÄêÁË£¬Í»È»Ïëдµã¶«Î÷£¬´óѧµÄʱºò¾ÍÓÐдÈռǵÄÏ°¹ß£¬µ«ÊÇ×Ô´ÓÈ¥Java06°àѧϰһֱµ½ÏÖÔÚ¹¤×÷£¬ÂýÂýµÄҲûÓÐʱ¼äȥдÈռǣ¬Ï£Íûͨ¹ýÕâƪÎÄÕÂÄÜÈÃJava˽ÛÓµÄѧµÜѧÃÃÃÇ¿´ÁËÓÐËù°ïÖú¡£
    ÏàÐźܶàͬѧºÜÎÒÒ»Ñù´óËĵÄʱºò¶¼±È½ÏÃÔ㣬ÓÈÆäÊÇÎÒ¶ÁµÄ¼ÆËã»úרҵ£¬ËµÊµ»°´óѧÀïѧµÄºÍÉç»áʵ¼ÊÐèÒªµÄ» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ