Java½â»ó3 32Ñ»·ÕßµÄ×çÖä
ÇëÌṩһ¸ö¶ÔiµÄÉùÃ÷£¬½«ÏÂÃæµÄÑ»·×ª±äΪһ¸öÎÞÏÞÑ»·£º
while (i <= j && j <= i && i != j) {
}
àÞ£¬²»£¬²»ÒªÔÙ¸øÎÒ¿´ÆðÀ´²»¿ÉÄܵÄÑ»·ÁË£¡Èç¹ûi <= j ²¢ÇÒ j <= i£¬i²»Êǿ϶¨µÈÓÚjÂð£¿ÕâÒ»ÊôÐÔ¶ÔʵÊý¿Ï¶¨ÓÐЧ¡£ÊÂʵÉÏ£¬ËüÊÇÈç´ËµØÖØÒª£¬ÒÔÖÁÓÚËüÓÐÕâÑùµÄ¶¨Ò壺ʵÊýÉϵÄ≤¹ØϵÊÇ·´¶Ô³ÆµÄ¡£JavaµÄ<=²Ù×÷·ûÔÚ5.0°æ֮ǰÊÇ·´¶Ô³ÆµÄ£¬µ«ÊÇÕâ´Ó5.0°æÖ®ºó¾Í²»ÔÙÊÇÁË¡£
Ö±µ½5.0°æ֮ǰ£¬JavaµÄÊý×ֱȽϲÙ×÷·û£¨<¡¢<=¡¢>ºÍ>=£©ÒªÇóËüÃǵÄÁ½¸ö²Ù×÷Êý¶¼ÊÇÔʼÊý×ÖÀàÐ͵ģ¨byte¡¢char¡¢short¡¢int¡¢long¡¢floatºÍdouble£©[JLS 15.20.1]¡£µ«ÊÇÔÚ5.0°æÖУ¬¹æ·¶×÷³öÁËÐ޸ģ¬Ð¹淶ÃèÊöµÀ£ºÃ¿Ò»¸ö²Ù×÷ÊýµÄÀàÐͱØÐë¿ÉÒÔת»»³ÉÔʼÊý×ÖÀàÐÍ[JLS 15.20.1£¬5.1.8]¡£ÎÊÌâÄѾÍÄÑÔÚÕâÀïÁË¡£
ÔÚ5.0°æÖУ¬×Ô¶¯°ü×°£¨autoboxing£©ºÍ×Ô¶¯·´°ü×°£¨auto-unboxing£©±»Ìí¼Óµ½ÁËJavaÓïÑÔÖС£Èç¹ûÄã¶ÔËüÃDz¢²»Á˽⣬Çë²é¿´£ºhttp://java.sun.com/j2se/5.0/docs/guide/language/autoboxing.html [Boxing]¡£<=²Ù×÷·ûÔÚÔʼÊý×ÖÀàÐͼ¯ÉÏÈÔÈ»ÊÇ·´¶Ô³ÆµÄ£¬µ«ÊÇÏÖÔÚËü»¹±»Ó¦Óõ½Á˱»°ü×°µÄÊý×ÖÀàÐÍÉÏ¡££¨±»°ü×°µÄÊý×ÖÀàÐÍÓУºByte¡¢Character¡¢Short¡¢Integer¡¢Long¡¢FloatºÍDouble¡££©<=²Ù×÷·ûÔÚÕâЩÀàÐ͵IJÙ×÷ÊýÉϲ»ÊÇ·´¶Ô³ÆµÄ£¬ÒòΪJavaµÄÅеȲÙ×÷·û£¨==ºÍ!=£©ÔÚ×÷ÓÃÓÚ¶ÔÏóÒýÓÃʱ£¬Ö´ÐеÄÊÇÒýÓÃIDµÄ±È½Ï£¬¶ø²»ÊÇÖµµÄ±È½Ï¡£
ÈÃÎÒÃǸü¾ßÌåһЩ£¬ÏÂÃæµÄÉùÃ÷¸³Óè±í´ïʽ(i <= j && j <= i && i != j)µÄֵΪtrue£¬´Ó¶ø½«Õâ¸öÑ»·±ä³ÉÁËÒ»¸öÎÞÏÞÑ»·£º
Integer i = new Integer(0);
Integer j = new Integer(0);
Ç°Á½¸ö×Ó±í´ïʽ£¨i <= j ºÍj <= i£©ÔÚiºÍjÉÏÖ´Ðнâ°üת»»[JLS 5.1.8]£¬²¢ÇÒÔÚÊý×ÖÉϱȽÏËù²úÉúµÄintÊýÖµ¡£iºÍj¶¼±íʾ0£¬ËùÒÔÕâÁ½¸ö×Ó±í´ïʽ¶¼±»¼ÆËãΪtrue¡£µÚÈý¸ö×Ó±í´ïʽ£¨i != j£©ÔÚ¶ÔÏóÒýÓÃiºÍjÉÏÖ´Ðбêʶ±È½Ï£¬ÒòΪËüÃǶ¼³õʼ»¯ÎªÒ»¸öеÄIntegerʵÀý£¬Òò´Ë£¬µÚÈý¸ö×Ó±í´ïʽͬÑùÒ²±»¼ÆËãΪtrue£¬Ñ»·Ò²¾ÍÓÀÔ¶µØ»·ÈÆÏÂÈ¥ÁË¡£
Äã¿ÉÄÜ»á¸Ðµ½Ææ¹Ö£¬ÎªÊ²Ã´ÓïÑԹ淶ûÓÐÐÞ¸ÄΪ£ºµ±ÅеȲÙ×÷·û×÷ÓÃÓÚ±»°ü×°µÄÊý×ÖÀàÐÍʱ£¬ËüÃÇÖ´ÐеÄÊÇÖµ±È½Ï¡£´ð°¸ºÜ¼òµ¥£º¼æÈÝÐÔ¡£µ±Ò»ÖÖÓïÑÔ±»¹ã·ºÊ¹ÓÃÖ®ºó£¬ÒÔÎ¥·´ÏÖÓй淶µÄ·½Ê½È¥¸Ä±äÏÖÓгÌÐòµÄÐÐΪÊÇÈÃÈËÎÞ·¨½ÓÊܵġ£ÏÂÃæµÄ³ÌÐò¹ýÈ¥×ÜÊDZ£Ö¤¿ÉÒÔ´òÓ¡false£¬Òò´ËËü±ØÐë¼ÌÐø±£³Ö´ËÌØÕ÷£º
public class ReferenceComparison {
public static v
Ïà¹ØÎĵµ£º
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
impo ......
JavaÊý¾ÝÀàÐÍ
HibernateÊý¾ÝÀàÐÍ
±ê×¼SQLÊý¾ÝÀàÐÍ
(PS:¶ÔÓÚ²»Í¬µÄDB¿ÉÄÜÓÐËù²îÒì)
byte¡¢java.lang.Byte
byte
TINYINT
short¡¢java.lang.Short
short
SMALLINT
int¡¢java.lang.Integer
integer
INGEGER
long¡¢java.lang.Long
long
BIGINT
float¡¢java.lang.Float
float
FLOAT
double¡¢java.lang.Doubl ......
1¡¢Óï·¨£º±ØÐë±È½ÏÊìϤ£¬ÔÚд´úÂëµÄʱºòIDEµÄ±à¼Æ÷¶ÔijһÐб¨´íÓ¦¸ÃÄܹ»¸ù¾Ý±¨´íÐÅÏ¢ÖªµÀÊÇʲôÑùµÄÓï·¨´íÎó²¢ÇÒÖªµÀÈκÎÐÞÕý¡£
2¡¢ÃüÁ±ØÐëÊìϤJDK´øµÄһЩ³£ÓÃÃüÁî¼°Æä³£ÓÃÑ¡ÏÃüÁîÖÁÉÙÐèÒªÊìϤ£ºappletviewer¡¢ HtmlConverter¡¢jar¡¢ java¡¢javac¡¢javadoc¡¢javap¡¢javaw¡¢native2ascii¡¢serialver£¬Èç¹ûÕâЩÃüÁ ......
ÇëÌṩһ¸ö¶ÔiµÄÉùÃ÷£¬½«ÏÂÃæµÄÑ»·×ª±äΪһ¸öÎÞÏÞÑ»·£º
while (i != 0) {
i >>>= 1;
}
»ØÏëһϣ¬>>>=ÊǶÔÓ¦ÓÚÎÞ·ûºÅÓÒÒƲÙ×÷·ûµÄ¸³Öµ²Ù×÷·û¡£0±»´Ó×óÒÆÈëµ½ÓÉÒÆλ²Ù×÷¶ø¿Õ³öÀ´µÄλÉÏ£¬¼´Ê¹±»ÒÆλµÄ¸ºÊýÒ²ÊÇÈç´Ë¡£
Õâ¸öÑ»·±ÈÇ°ÃæÈý¸öÑ»·ÒªÉÔ΢¸´ÔÓÒ»µã£¬ÒòΪÆäÑ»·Ìå·Ç¿Õ¡£ÔÚÆäÑ»·ÌâÖУ¬ ......