java×°ÏäÓë²ðÏä
/**
* ==ºÅÊDZȽÏÁ½¸ö»ù±¾ÀàÐÍÊÇ·ñÏàµÈ,»òÕ߱ȽÏÁ½¸ö¶ÔÏóÒýÓÃÊÇ·ñÏàͬ
*/
public class T {
public static void main(String[] args) {
Integer i1 = 128;
Integer i2 = 128;
int i3 = 128;
int i4 = 128;
Integer i5 = 127;
Integer i6 = 127;
Long long1 = 128L;
Long long2 = 128L;
long long3 = 128L;
long long4 = 128L;
long long5 = -128L;
long long6 = -128L;
//-128 ~ 127Ö®¼äÊýÖµ×°Ïäʱ»á¹²ÏíÄڴ渱±¾, ³¬¹ýÕâ¸ö·¶Î§£¬Ôò²»»á¹²ÏíÒýÓ㬼´¶ÔÏóµØÖ·½«²»Í¬
System.out.println(i1 == i2); //ʵÖÊÊDZȽÏÁ½¸ö²»Í¬ÒýÓà false
System.out.println(i5 == i6); //ʵÖÊÊDZȽÏÁ½¸öÏàͬ£¨¹²Ïí£©ÒýÓÃtrue
System.out.println(i1 == i3); //ÏȽ«i1²ðÏ䣬Ȼºó±È½Ï»ù±¾ÀàÐÍ true
System.out.println(i1.equals(i4)); //ÏȽ«i4×°Ï䣬Ȼºó±È½Ï»ù±¾ÀàÐÍ true
System.out.println(long1 == long2);//Á½¸öÒýÓò»Í¬ false
System.out.println(long5 == long6);//¹²Óø±±¾ true
System.out.println(long1 == long3);//long1ÏȲðÏ䣬 ÔÚ±È½Ï true
System.out.println(long2.equals(long4));//long4ÏÈ×°Ïä, ÔÙequals, true
}
}
Ïà¹ØÎĵµ£º
ÔÚjava¿ª·¢µÄÔçÆÚ£¬Öص㱻·ÅÔÚÁ˿ͻ§¶Ë¿ª·¢¡£ÓïÑÔÖжÔÓÚappletºÍ°²È«ÏÂÔØµÄÖ§³Ö
¶ÔÓÚÍòÎ¬Íø£¨WWW£©µÄ·¢²¼¿´ÉÏÈ¥ÊǸö²»´íµÄÖ÷Òâ¡£µ«ÊÇÏÖʵÊÇjava×î´óµÄ³É¹¦ÔÚÓÚ·þÎñÆ÷¶Ë£¬javaµÄÇ¿´ó¹¦ÄܺÍÊÊÓ¦ÐÔÓ®µÃÁË·þÎñÆ÷¶Ë¿ª·¢ÕßµÄÐÄ¡£Í¬Ê±£¬¿Í»§¶ËµÄ¿ª·¢ÂäºóÁË¡£¼¬ÊֵĿª·¢ÎÊÌâÏÞÖÆÁËappletµÄЧÓ㬿ª·¢Õß±»ÆÈתÏò»ùÓÚä¯ÀÀÆ÷µÄÊݿͻ§¶ ......
Java ÓïÑÔµÄCalendar(ÈÕÀú),Date(ÈÕÆÚ), ºÍDateFormat(ÈÕÆÚ¸ñʽ)×é³ÉÁËJava±ê×¼µÄÒ»¸ö»ù±¾µ«ÊǷdz£ÖØÒªµÄ²¿·Ö. ÈÕÆÚÊÇÉÌÒµÂß¼¼ÆËãÒ»¸ö¹Ø¼üµÄ²¿·Ö. ËùÓеĿª·¢Õß¶¼Ó¦¸ÃÄܹ»¼ÆËãδÀ´µÄÈÕÆÚ, ¶¨ÖÆÈÕÆÚµÄÏÔʾ¸ñʽ, ²¢½«Îı¾Êý¾Ý½âÎö³ÉÈÕÆÚ¶ÔÏó. ÎÒÃÇдÁËÁ½ÆªÎÄÕÂ, ÕâÊǵÚһƪ, Î ......
public class FilePath {
public void Print() {
String a = this.getClass().getClassLoader().getResource(".").getPath();
String b = this.getClass().getResource("").getPath();
String c = this.getClass().getResource(" ").getPath();
&n ......
Óà Groovy ±àд¸üÉٵĴúÂ룬Íê³É¸ü¶àµÄ¹¤×÷
¼¶±ð£º ³õ¼¶
Scott Davis , ´´Ê¼ÈË, ThirstyHead.com
2009 Äê 3 ÔÂ 09 ÈÕ
Groovy ר¼Ò Scott Davis ½«ÖØÐ¿ªÊ¼×«Ð´ ʵս Groovy ϵÁÐÎÄÕ£¬¸ÃϵÁÐÎÄÕÂÓÚ 2006 ÄêÍ£Ö¹±àд¡£×÷Ϊ¿ªÆªÎÄÕ£¬±¾ÎĽ«½éÉÜ Groovy ×î½üµÄ·¢Õ¹ÒÔ¼° Groovy µ±Ç°µÄ״̬¡£È»ºóÁ˽ⴠ......