javaÖеÄÏàµÈÐÔ×ܽá
ѧjavaÓжÎʱ¼äÁË£¬ÒÔÏÂÊǸöÈ˵ÄÒ»µãÐĵÃÌå»á£¬Ï£ÍûÄܹ»°ïÖúÄÇЩ¸Õ¿ªÊ¼±à³ÌµÄͬ־ÃÇ¡£
¼¸ÌìÇ°£¬Ò»Í¬Ñ§ÈÃÎÒ°ïæ¿´ËûµÄ³ÌÐòµ½µ×³öÏÖʲôÎÊÌ⣬´úÂë±È½ÏÂÒ£¬Ò²Ã»ÓÐ×¢ÊÍ£¬ÎÒ¿´Á˺Ü
³¤Ò»¶Îʱ¼ä¾¹ÊÇÕÒ²»µ½ÎÊÌâËùÔÚ¡£³ÌÐò´óÌåÊÇÕâÑùµÄ£¬ÓÐÒ»¶ÎÎı¾taxt,´ÓÖмäÕÒ³öÈÎÒâ´ÊÓï¾ä×Ó½øÐÐÌæ
»»£¬µ±Ê±ËûʹÓÃifÅжϺó½øÐÐÌæ»».
String selectText=Text.area1.getSelectedText();
String searchText = Text.searchText;
if(selectText == searchText)
{
.......
}
дµ½ÕâÀï¹À¼ÆÃ÷ÑÛÈËÒ»¿´¾ÍÖªµÀÎÊÌâËùÔÚ£¬==µÄʹÓÃÓÐÎÊÌ⣡ÓÉÓÚ×Ô¼º¶ÔÕⲿ·ÖÄÚÈݱȽÏÉúÊ裬ËùÒÔÉÏ
ÍøËÑÁËһϷ¢ÏÖÓв»ÉÙÈËÅöµ½equalÓë==µÄÎÊÌ⣬³öÓÚ¼ÓÉîÀí½â¾ö¶¨Ð´Ò»ÆªÎÄÕ£¬Ð´µÄ²»ºÃ»¶ÓÅÄש£¬
ÒÔÆÚÅ×שÒýÓñ֮Ч£¬»¹Çë¸ßÊÖ²»Áߴͽ̡£
ÏàÐÅѧϰjavaµÄͬ־ÃǶ¼Çå³þ£¬ÄÇôÏÖÔÚ´ò¿ªAPI¿´Ò»¿´Ààobject°É£¬Object ÊÇÀà²ã´Î½á¹¹µÄ¸ùÀà¡£
ÿ¸öÀ඼ʹÓà Object ×÷Ϊ³¬Àà¡£ËùÓжÔÏ󣨰üÀ¨Êý×飩¶¼ÊµÏÖÕâ¸öÀàµÄ·½·¨£¬ObjectÓÐÒ»¸ö¹¹Ô캯Êý¡£
public int hashCode()
public boolean equals(Object obj)
public String toString()
protected void finalize()
protected Object clone()
public final Class<?> getClass()
public final void notify()
public final void notifyAll()
public final void wait(long timeout)
public final void wait(long timeout,int nanos)
public final void wait()
ÊýÁËһϳý¹ý¹¹Ô캯Êý£¬Object×ܹ²ÓÐ11¸ö¶ÔÍâ¿ÉʹÓõķ½·¨£¬½«Õâ11¸ö·½·¨°´ÕÕÊÇ·ñ¿ÉÒԼ̳ÐÖØдÀ´»®
·Ö£¬¿ÉÒÔ¿´µ½ÎÒÃDZȽϳ£Óõļ¸¸ö·½·¨toString(),equals(),hashCode()²»³£Óõ«ÔÚʹÓÃMapʱºÜÖØÒª¶ø
ÇÒºÜÈÝÒ׳öÎÊÌ⣬½ÓÏÂÀ´ÎÒÃǾͼ¯Öп´¿´Õ⼸¸ö·½·¨£¬
²é¿´jdkÖеÄÔ´´úÂë:
package java.lang;
public boolean equals(Object obj) {
return (this == obj);
}
public String toString() {
return getClass().getName()+ "@"
+Integer.toHexString(hashCode());
}
public native int hashCode();
¿ÉÒÔ¿´µ½£¬ObjectÌṩµÄequals·½·¨ÊÇͨ¹ý"=="ʵÏֵģ¬ ¶øThink in java(4th) P44Ò³
public class Equivalence
{
public static void main(String[] args)
{
Integer a = new Integer(4);
Intege
Ïà¹ØÎĵµ£º
±ÊÕßÔÚJava¿ª·¢Öг£³£»áÓöµ½½«Êý¾Ý¿âÊý¾Ýµ¼³öµ½ExcelµÄÒªÇ󣬱ÈÈçÔÚÎÒµÄÒ»¸öÏîÄ¿ÖУ¬¿Í»§ÒªÇóËùÓвéѯ½á¹û¶¼¿ÉÒÔµ¼³öµ½Excel£¬¶ÔÓÚÊý¾ÝÁ¿²»´óµÄ£¨¼¸ÍòÌõ£©£¬Õâ±È½ÏÈÝÒ×ʵÏÖ£¬µ«¶ÔÓÚÊý¾ÝÁ¿±È½Ï´óµÄ£¨¼¸Ê®Íò¼°ÒÔÉÏ£¬¾ßÌåÒª¿´µ¼³öÄÚÈݵÄ×ֶθöÊýºÍ³¤¶Ì£©£¬ÔòÔÚÊý¾Ý¿â²éѯºÍÉú³ÉexcelÎļþÉ϶¼»áÓÐÂé·³¡£
ÒÔÎÒÔÚʵ¼ÊÏîÄ¿ÖеÄÒ»¸ ......
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
public class CipherTest {
public static void main(String[] args) {
try {
byte[] keydata = { (byte) 0x00, (byte) 0x01, (byte) 0x02,
(byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06,
......
package homework01;
public class TestWhile {
public static double factorial(int n) //Çó½×³Ëº¯Êý
{
if(n==0) return 1;
else return n* factorial(n-1);
}
public static void main(String[] args) {
System.out.println(factorial(170));//test:ÄÜ´òÓ¡³öÀ´£ ......
һЩjavaÀàÖÐΪʲôÐèÒªÖØÔØ serialVersionUID ÊôÐÔ¡£
ÔÚJavaÖУ¬Èí¼þµÄ¼æ
ÈÝÐÔÊÇÒ»¸ö´óÎÊÌ⣬ÓÈÆäÔÚʹÓõ½¶ÔÏó´®ÐÐÐÔµÄʱºò£¬ÄÇôÔÚijһ¸ö¶ÔÏóÒѾ±»´®Ðл¯ÁË£¬¿ÉÊÇÕâ¸ö¶ÔÏóÓÖ±»Ð޸ĺóÖØв¿ÊðÁË£¬ÄÇôÔÚÕâÖÖÇé¿öÏ£¬
ÓÃÀÏÈí¼þÀ´¶ÁÈ¡ÐÂÎļþ¸ñʽËäÈ»²»ÊÇʲôÄÑÊ£¬µ«ÊÇÓпÉÄܶªÊ§Ò»Ð©ÐÅÏ¢¡£
serialVersionUID
À´½â ......
±¾ÆªÎÄÕÂÀ´Ô´ÓÚ£º¿ª·¢Ñ§Ôº http://edu.codepub.com ÔÎÄÁ´½Ó£ºhttp://edu.codepub.com/2010/0221/20469.php
½Ó¿ÚÉêÃ÷±ØÐëÓÐinterface¹Ø¼ü×ֺͽӿڵÄÃû×Ö£¬publicÖ¸Ã÷ÈÎÒâÀà¾ù¿ÉÒÔʹÓÃÕâ¸ö½Ó¿Ú£¬Ä¬ÈÏÇé¿öÏ£¬Ö»ÓÐÓë¸Ã½Ó¿Ú¶¨ÒåÔÚͬһ¸ö°üÖеÄÀà²Å¿ÉÒÔ·ÃÎÊÕâ¸ö½Ó¿Ú¡£extends ÓëÀà ......