¹ØÓÚjavaÖеĴ洢ÎÊÌâ
ÐÂÊÖ¸ÐÎò……
¾Í¸öÈËÀí½â£¬javaÖзÖΪ»ù±¾Êý¾ÝÀàÐÍ»¹ÓжÔÏ󡣶ÔÓÚ»ù±¾Êý¾ÝÀàÐÍ¡£ÔÚ¸³Öµ²Ù×÷Öд«µÝµÄÊÇÖµ£¬¶ø²»ÊÇÒýÓá£ÀýÈç
int a = 10;
int b = a;
int b = 11;
Õâʱ£¬Êä³öa,b¿ÉÒÔ·¢ÏÖ¡£a = 10 ,b = 11;ÔÚb = aÕâ¸ö¸³Öµ²Ù×÷ÖУ¬Êǽ«a¶ÔÓ¦µÄÖµ´«µÝ¸øÁËb¡£¶ø²»Êǽ«bµÄÒýÓÃÖ¸ÏòÁËaµÄ¡£µ±È»£¬ÎÊÌâÀ´ÁË¡£ÕâÀï˵£¬aÓëbÔÚ¸³Öµ²Ù×÷ºó²¢²»ÊÇÖ¸ÏòÏàͬµÄÄÚ´æµØÖ·¡£ÄÇΪʲô»á´æÔÚ a == b ΪÕæµÄÇé¿öÄØ£¿ÕâÀïµÄ»°£¬Ó¦¸ÃÊÇÔÚÄÚ´æÖÐÓÐÒ»²¿·Ö¿Õ¼äÀ´µ¥¶À´æ·ÅÁËjavaÖеĻù±¾Êý¾ÝÀàÐÍÖµ¡£µ±ÓÐÀàËÆÓÚint I = 10;µÄ¸³Öµ²Ù×÷µÄʱºò£¬Ö¸ÏòµÄ¶Ô10ÔÚÄÚ´æÖеØÖ·µÄ¡£ËùÒÔa,bÊÇÖ¸ÏòÏàͬµÄÄÚ´æµØÖ·µÄ¡£
¹ØÓÚString,ÊǸöºÜÆæ¹ÖµÄ¶ÔÏó¡£ÎÒÃÇ¿ÉÒÔͨ¹ýÏÂÃæµÄ´úÂë·¢ÏÖ£º
String a = "111";
String b = new String("111");
System.out.println(a == b);
System.out.println(a.equals(b));
a = b;
String c = new String("111");
System.out.println(a == c);
System.out.println(a == b);
ÕâÀïÊä³öµÄÖµÊÇ
false
true
false
true
Õâ˵Ã÷ÁËÒ»¸öÎÊÌâ¡£µ±String½øÐи³Öµ²Ù×÷Ö®ºó±ä³ÉÁËÓëintÏàͬµÄÇé¿ö¡£µ«ÊÇͨ¹ýnewÉú³ÉµÄÈ·ÊDz»Í¬µÄ¡£µ±String±»new Ö®ºó£¬ÊÇÒÔchar[]µÄÐÎʽ´æ´¢ÔÚÄÚ´æÖеġ£ÓëÕûÐÍÏàͬ£¬charÒ²ÊÇ»ù±¾ÀàÐÍ¡£ËùÒÔStringÔÚÄÚ´æÖÐÉú³ÉÁËÒ»¸öеÄchar[]¡£µ«ÊǸ³ÖµÖ®ºó£¬±ãÖ¸ÏòÁËÏàͬµÄÄÚ´æ¿Õ¼ä¡£
¶ÔÓÚ¶ÔÏó¡£Ó¦¸ÃÒª·Ö³ÉÁ½¸ö²¿·Ö¡£µ±¶ÔÏó±»newÖ®ºó¡£ÓÐÁ½¸ö´æÔÚ¡£´æÔÚÓÚÄÚ´æ¶ÑÖеÄÊǶÔÏóµÄʵÌå¡£°üÀ¨ËùÓжÔÏóÖд洢ÐÅÏ¢¡£ÔÚÕ»ÖУ¬´æÔÚÒ»¸ö¶Ô¸ÃʵÌåµÄÒýÓ᣼´Ö¸Ïò¸ÃÄÚ´æµØÖ·µÄÒýÓᣵ±¸³Öµ²Ù×÷ʱ£¬´«µÝÊǵÄÊÇÒÀÈ»ÊÇÖµ£¬Ö»²»¹ýÕâ¸öÖµÊǶÔÓÚÄÚ´æʵÌå¶ÔÏóµÄÒýÓá£ÀàËÆÓÚÁ½¸öÖ¸Ïòͬһ¸öÄÚ´æÇøÓòµÄÖ¸Õë¡£µ±ÆäÖÐÒ»¸ö·¢Éú±ä»¯µÄʱºò£¨Ö±½Ó¸´ÖÆ£©£¬¸Ä±äµÄ½ö½öÊÇÔÚÕ»ÖеÄÒýÓõØÖ·¡£²¢²»»áÖ±½ÓÓ°Ïìµ½ÄÚ´æ¶ÑÖд洢µÄÊýÖµ¡£
ÕâÖÖ´æ´¢ÌåÊǺܳ£¼ûµÄ¡£³ý¿ª»ù±¾ÀàÐÍÖ®ÍâµÄ£¬¶¼ÊÇ¡£°üÀ¨int[]»¹ÓÐchar[]µÈ¡£
ÏÖÔÚÎÒÃÇ¿ÉÒÔÉèÏëÕâÑùÒ»¸öÎÊÌ⣻
Ò»¸öListÖдæÁË1¸öint£¬1¸öStrin
Ïà¹ØÎĵµ£º
JAVAÖÐÓÃÓÚ´¦Àí×Ö·û´®³£ÓõÄÓÐÈý¸öÀࣺjava.lang.String¡¢java.lang.StringBuffer¡¢java.lang.StringBuilder£¬ÕâÈýÕߵĹ²Í¬Ö®´¦¶¼ÊÇfinalÀ࣬²»ÔÊÐí±»¼Ì³Ð£¬ÕâÖ÷ÒªÊÇ´ÓÐÔÄܺͰ²È«ÐÔÉÏ¿¼Âǵģ¬ÒòΪÕ⼸¸öÀ඼ÊǾ³£±»Ê¹ÓÃ×ŵģ¬ÇÒ¿¼Âǵ½·ÀÖ¹ÆäÖеIJÎÊý±»ÐÞ¸ÄÓ°Ïìµ½ÆäËüµÄÓ¦Óá£StringBufferÓëStringBuilderÁ½¸ö»ù±¾Éϲ¶à£ ......
ÈÏÇåJavaScriptºÍJAVAÈ«¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿µÄ×÷ÓÃÓò
2010Äê2ÔÂ28ÈÕ george ·¢±íÆÀÂÛ ÔĶÁÆÀÂÛ
ͨ¹ýÌÔ±¦ÃæÊÔÌâÀ´ÈÏÇåJavaScriptºÍJAVAÈ«¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿µÄ×÷ÓÃÓò
×¢ÒâÁ½ÕßÊÇÓÐÑÏÖØÇø±ðµÄ£¡
var a = 100;
function testResult(){
var b = 2 * a;
var a = 200;
var c = a / 2 ......
ö¾ÙÀàÐÍÊÇJDK5.0µÄÐÂÌØÕ÷¡£SunÒý½øÁËÒ»¸öȫеĹؼü×ÖenumÀ´¶¨ÒåÒ»¸öö¾ÙÀà¡£ÏÂÃæ¾ÍÊÇÒ»¸öµäÐÍö¾ÙÀàÐ͵Ķ¨Ò壺
¡¡¡¡Java´úÂë
¡¡¡¡public enum Color{
¡¡¡¡RED,BLUE,BLACK,YELLOW,GREEN
¡¡¡¡}
¡¡¡¡public enum Color{
¡¡¡¡RED,BLUE,BLACK,YELLOW,GREEN
}
ö¾ ......
javaÖг£ÓõÄÊý¾Ýת»»
ǰЩÌìÔÚÏîÄ¿ÖÐÓöµ½ÁËCalenderºÍDateµÄÏ໥ת»»ÎÊÌ⣬Ȼºó¾Í²éÁËһЩ×ÊÁÏ¡£ÕûÀíÁËһЩÏà¹ØµÄ³£ÓÃת»»£¬ºÍ´ó¼Ò·ÖÏíÏ£º
1. Java°ü×°ÀࣺÔÚ½éÉܾßÌåµÄÊý¾ÝÀàÐÍת»»Ö®Ç°£¬ÎÒÃÇÓбØÒªÏȽéÉÜjavaÖеÄÒ»¸öÌØÊâµÄ²ð×°ÏäÀàÐÍ----java°ü×°Àà¡£
• Java°ü×°Àà³öÏÖµÄÄ¿µÄ£ºÎªÁËÄܹ»Ê¹java³ÌÐòÔ±¿ÉÒÔ½«ja ......
ÎÒÃÇÖªµÀ£¬Vector ÀàÌṩÁËʵÏÖ¿ÉÔö³¤Êý×éµÄ¹¦ÄÜ£¬Ëæןü¶àÔªËؼÓÈëÆäÖУ¬Êý×é±äµÄ¸ü´ó¡£ÔÚɾ³ýһЩԪËØÖ®ºó£¬Êý×é±äС¡£
Vector ÓÐÈý¸ö¹¹Ô캯Êý£¬
public Vector(int initialCapacity,int capacityIncrement)
public Vector(int initialCapacity)
public Vector()
......