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

java equalsÓë== µÄÇø±ð

equals ·½·¨ÊÇ java.lang.Object ÀàµÄ·½·¨¡£
ÓÐÁ½ÖÖÓ÷¨ËµÃ÷£º
£¨1£©¶ÔÓÚ×Ö·û´®±äÁ¿À´Ëµ£¬Ê¹ÓÓ==”ºÍ“equals()”·½·¨±È½Ï×Ö·û´®Ê±£¬Æä±È½Ï·½·¨²»Í¬¡£
“==”±È½ÏÁ½¸ö±äÁ¿±¾ÉíµÄÖµ£¬¼´Á½¸ö¶ÔÏóÔÚÄÚ´æÖеÄÊ×µØÖ·¡£
“equals()”±È½Ï×Ö·û´®ÖÐËù°üº¬µÄÄÚÈÝÊÇ·ñÏàͬ¡£
±ÈÈ磺
String s1,s2,s3 = "abc", s4 ="abc" ;
s1 = new String("abc");
s2 = new String("abc");
ÄÇô£º
s1==s2 ÊÇ false      //Á½¸ö±äÁ¿µÄÄÚ´æµØÖ·²»Ò»Ñù£¬Ò²¾ÍÊÇ˵ËüÃÇÖ¸ÏòµÄ¶ÔÏó²» Ò»Ñù£¬
¹Ê²»ÏàµÈ¡£
s1.equals(s2) ÊÇ true     //Á½¸ö±äÁ¿µÄËù°üº¬µÄÄÚÈÝÊÇabc£¬¹ÊÏàµÈ¡£
×¢Ò⣨1£©£º
Èç¹û£º          StringBuffer s1 = new StringBuffer("a");
StringBuffer s2 = new StringBuffer("a");
½á¹û£º           s1.equals(s2) //ÊÇfalse
½âÊÍ£ºStringBufferÀàÖÐûÓÐÖØÐ¶¨ÒåequalsÕâ¸ö·½·¨£¬Òò´ËÕâ¸ö·½·¨¾ÍÀ´×ÔObjectÀ࣬
          ¶øObjectÀàÖеÄequals·½·¨ÊÇÓÃÀ´±È½Ï“µØÖ·”µÄ£¬ËùÒÔµÈÓÚfalse.
×¢Ò⣨2£©£º
¶ÔÓÚs3ºÍs4À´Ëµ£¬ÓÐÒ»µã²»Ò»ÑùÒªÒýÆð×¢Ò⣬ÓÉÓÚs3ºÍs4ÊÇÁ½¸ö×Ö·û
´®³£Á¿ËùÉú³ÉµÄ±äÁ¿£¬ÆäÖÐËù´æ·ÅµÄÄÚ´æµØÖ· ÊÇÏàµÈµÄ£¬
ËùÒÔs3==s4ÊÇtrue£¨¼´Ê¹Ã»ÓÐs3=s4ÕâÑùÒ»¸ö¸³ÖµÓï¾ä£©
£¨2£©¶ÔÓÚ·Ç×Ö·û´®±äÁ¿À´Ëµ£¬"=="ºÍ"equals"·½·¨µÄ×÷ÓÃÊÇÏàͬµÄ¶¼ÊÇÓÃÀ´±È½ÏÆä
¶ÔÏóÔÚ¶ÑÄÚ´æµÄÊ×µØÖ·£¬¼´ÓÃÀ´±È½ÏÁ½¸öÒýÓñäÁ¿ÊÇ·ñÖ¸Ïòͬһ¸ö¶ÔÏó¡£
±ÈÈ磺
class A
{
      A obj1   =    new A();
      A obj2   = new A();
}
ÄÇô£ºobj1==obj2ÊÇfalse
            obj1.equals(obj2)ÊÇfalse
µ«ÊÇÈç¼ÓÉÏÕâÑùÒ»¾ä£ºobj1=obj2;
ÄÇô obj1==obj2 ÊÇtrue
          obj1.equals(obj2) ÊÇtrue
×ÜÖ®£ºequals·½·¨¶ÔÓÚ×Ö·û´®À´ËµÊDZȽÏÄÚÈݵ쬶ø¶ÔÓÚ·Ç×Ö·û´®À´ËµÊDZȽÏ
ÆäÖ¸ÏòµÄ¶ÔÏóÊÇ·ñÏàͬµÄ¡£
             == ±È½Ï·ûÒ²ÊDZȽÏÖ¸ÏòµÄ¶ÔÏóÊÇ·ñ


Ïà¹ØÎĵµ£º

Java SWT ´°¿Ú¾ÓÖÐ¶ÔÆë

public static void CentreWnd(Shell shell){
int width = shell.getMonitor().getClientArea().width;
int height = shell.getMonitor().getClientArea().height;
int x = shell.getSize().x;
int y = shell.getSize().y;
if (x > width) {
shell.getSize().x = width;
}
if (y > height) ......

ÁíÎÒÓôÃÆÖÂËÀµÄJAVA socketÎÊÌâ

ͬÑùµÄ³ÌÐò£¬ÔÚ±ðÈ˵ĵçÄÔÉ϶¼¿ÉÒÔÓã¬ÔÚÎҵĵçÄÔÉÏÈ´ÎÞÂÛÈçºÎ¶¼Í¨²»¹ý£¬ÓôÃÆ°¡¡£
×òÌìÓöµ½Ò»¸öÎÊÌâ¸ãÁËÒ»Ì춼ûÓнâ¾ö£¬
Õâ¸ö³ÌÐòÔÚ±ðÈ˵ĵçÄÔÉÏÓö¼¿ÉÒÔͨ¹ý£¬Ö»ÓÐÔÚÎҵĵçÄÔÉÏÎÞ·¨Í¨¹ý
£¬ÎÒÒ»¿ªÊ¼×°µÄÊÇJDK6.0£¬ºóÀ´Ð¶ÔØÁË×°³ÉÁËJDK5.0£¨ÎªÁ˺ÍËùѧ½Ì³Ì±£³ÖÒ»Ö£¬
ÒÔ¼°ÎÒËÞÉáͨ¹ý²âÊԵĻúÆ÷Ò²ÊÇ×°µÄJDK5.0£©£¬
µ«ÊÇ ......

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


ÔÚÐÅϢʱ´ú£¬ÍøÂç¼¼ÊõÓ¦ÓÃÒѷdz£ÆÕͨ¡£ÆäÖзdz£¶àÓ¦Óö¼ÒÀÀµÓÚ´ÓÒ»¸öÖ÷»úÏò¶à¸öÖ÷»ú»ò´Ó¶à¸öÖ÷»úÏò¶à¸öÖ÷»ú·¢ËÍͬһÐÅÏ¢µÄÄÜÁ¦£¬ÔÚInternetÉÏ·Ö·¢µÄÊýÄ¿¿ÉÄÜ´ïÊýÊ®Íǫ̀£¬ÕâЩ¶¼ÐèÒª¸ü¸ßµÄ´ø¿í£¬²¢ÇÒ´ó´ó³¬³öÁ˵¥²¥µÄÄÜÁ¦¡£Ò»ÖÖÄÜ×î´óÏ޶ȵØÀûÓÃÏÖÓдø¿íµÄÖØÒª¼¼ÊõÊÇIP×é²¥¡£
1£®IP×é²¥¼¼ÊõµÄ¸ÅÄî
IP×é²¥¼¼Êõ£¬ÊÇÒ»ÖÖÔÊ ......

½ÌÄãÔÚJavaÓ¦ÓóÌÐòÖж¯Ì¬µÄ·ÖÅäCPU×ÊÔ´

JavaµÄÏ̵߳÷¶È²Ù×÷ÔÚÔËÐÐʱÊÇÓëÆ½Ì¨Î޹صġ£Ò»¸ö¶àÈÎÎñϵͳÐèÒªÔÚÈÎÎñÖ®¼äʵÏÖQoS(Quality of Service)¹ÜÀíʱ£¬Èç¹ûCPU×ÊÔ´µÄ·ÖÅä»ùÓÚJavaÏ̵߳ÄÓÅÏȼ¶£¬ÄÇôËüÔÚ²»Í¬Æ½Ì¨ÉÏÔËÐÐʱµÄЧ¹ûÊǺÜÄÑÔ¤²âµÄ¡£±¾ÎÄÀûÓÃЭµ÷ʽ¶àÈÎÎñÄ£ÐÍ£¬Ìá³öÒ»¸öÓëÆ½Ì¨Î޹ء¢²¢ÇÒÄÜÔÚÈÎÎñ¼ä¶¯Ì¬·ÖÅäCPU×ÊÔ´µÄ·½°¸¡£
ÏÖÔÚ£¬ÓÉÓÚ¼ÆËã»úϵͳÒѾ­´ÓÈ ......

Java·¾¶ÎÊÌâ×îÖÕ½â¾ö·½°¸

ǰÑÔ
¡¡¡¡JavaµÄ·¾¶ÎÊÌ⣬·Ç³£ÄѸ㡣×î½üµÄ¹¤×÷Éæ¼°µ½´´½¨ºÍ¶ÁÈ¡ÎļþµÄ¹¤×÷£¬ÕâÀïÎҾ͸ø´ó¼Ò³¹µ×µÃ½â¾öJava·¾¶ÎÊÌâ¡£
¡¡
¡¡ÎÒ±àдÁËÒ»¸ö·½·¨£¬±ÈClassLoader.getResource(String
Ïà¶Ô·¾¶)·½·¨µÄÄÜÁ¦¸üÇ¿¡£Ëü¿ÉÒÔ½ÓÊÜ"../"ÕâÑùµÄ²ÎÊý£¬´ðÓ¦ÎÒÃÇÓÃÏà¶Ô·¾¶À´¶¨Î»classpathÍâÃæµÄ×ÊÔ´¡£ÕâÑù£¬ÎÒÃǾͿÉÒÔʹÓÃÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ