JAVAÖеÄλÒƲÙ×÷ >> >>
ÖÐС
JavaÖй²ÓÐÈý¸öÒÆλ²Ù×÷·û£¬·Ö±ðÊÇ£º
<<£º×óÒƲÙ×÷£¬ËùÓвÙ×÷ÊýÏò×óÒƶ¯£¬Ã¿ÒÆһλ×îÓÒ±ßÓÃ0²¹³ä
>>£º´ø·ûºÅλÓÒÒÆ£ºÁ¬Í¬·ûºÅλһÆðÓÒÒÆ£¬Ã¿ÒÆһλ×î×ó±ßÓ÷ûºÅλ²¹³ä
>>>£ºÎÞ·ûºÅÓÒÒÆ£ºÁ¬Í¬·ûºÅλһÆðÓÒÒÆ£¬Ã¿ÒÆһλ×î×ó±ßÓÃ0²¹³ä
ÒÆλ²Ù×÷·ûÖ»ÄÜ×÷ÓÃÓÚÕûÊýÀàÐÍ£¬¼´byte£¬short£¬char£¬int£¬long
ÒÆλ²Ù×÷¶¼ÊǶÔ×ó²Ù×÷ÊýËù¶ÔÓ¦µÄ»úÆ÷Êý£¨²¹ÂëÐÎʽ£©½øÐеġ£¶øÐèÒªÌرð×¢ÒâµÄÊÇ£¬ÌâÄ¿Öиø³öµÄ×ó²Ù×÷Êý£¨¼´ÎÒÃÇÔÚ³ÌÐòÖÐд³öµÄ£©¶¼ÊǷDz¹ÂëÐÎʽµÄ£¨Ê®½øÖƲ»ÓÃ˵£¬Ê®Áù½øÖÆ¡¢°Ë½øÖÆÒ²ÊÇÒ»°ãµÄÐÎʽ¶ø·Ç²¹Â룩£¬¹ÊÎÒÃÇÔÚÔ¤²âÒÆλ½á¹ûʱһ¶¨ÒªÏȽ«¸ø³öµÄ×ó²Ù×÷Êýת»»³É²¹ÂëÐÎʽ£¬ÔÙ½øÐÐÒÆλ²Ù×÷£¬Ö®ºóÔÙÓɲ¹ÂëÐÎʽת»»³ÉÆÕͨµÄ¶þ½øÖÆÐÎʽµÄÕæÖµ£¬ÔÙÀ´¼ÆËãÎÒÃÇËù˵µÄ×îÖÕ½á¹ûÖµ¡££¨ÐèҪ˵Ã÷µÄÊÇ£¬ÆÕͨ¶þ½øÖÆÐÎʽµÄÊý£¨ÊýµÄÕæÖµ£©ºÍÆä²¹ÂëµÄת»»¹æÔò¡£ÖªµÀÒ»¸öÊýµÄÕæÖµ£¬ÇóÆä²¹ÂëµÄ¹æÔòÊÇ£ºÕýÊýµÄ²¹ÂëºÍÕæÖµÏàͬ£»¸ºÊýµÄ²¹ÂëµÄÇó·¨ÊÇ£ºÕæÖµµÄ·ûºÅλ²»±ä£¬ÆäÓà¸÷λ°´Î»È¡·´£¬Ä©Î»¼Ó1¡£ ¶øÖªµÀÒ»¸öÊýµÄ²¹Â룬ÇóÆäÕæÖµµÄ¹æÔòÏàͬ£ºÕýÊýµÄÕæÖµºÍÆä²¹ÂëÏàͬ£»¸ºÊýµÄ²¹ÂëµÄÕæÖµµÄÇó·¨ÊÇ£º·ûºÅλ²»±ã£¬ÆäÓà¸÷λ°´Î»È¡·´£¬Ä©Î»¼Ó1¡£ Ìرð×¢Ò⣺0µÄ²¹ÂëÖ»ÓÐÒ»¸ö£ºÒÔbyte ΪÀý£º0µÄ²¹ÂëΪ£º00000000£¬1000000±íʾ-128£©
ÒÆλÔËËãµÄÓÒ²Ù×÷Êý£¨Êµ¼ÊÒƶ¯Î»Êý£©µÄ¼ÆËã·½·¨ÊÇ£ºÓÒ²Ù×÷Êý%´ËÀàÐÍÊýµÄ×î´ó±íʾλÊý¡£
ÀýÈ磺 int x = 2£» int y = x >> 34;
µÈ¼ÛÓÚ£ºint x = 2£» int y = x >> 2; //34 % 32 = 2
§ 3.4λ ÔË Ëã ·û
λ ÔË Ëã ·û Óà À´ ¶Ô ¶þ ½ø ÖÆ Î» ½ø ÐÐ ²Ù ×÷ ,JavaÖÐ Ìá ¹© ÁË Èç Ï ±í Ëù ʾ µÄ λ ÔË Ëã ·û :
λ ÔË Ëã ·û ÖÐ ,³ý ¡¡ ¡« ¡¡ ÒÔ Íâ ,Æä Óà ¾ù Ϊ ¶þ Ôª ÔË Ëã ·û ¡£
²Ù ×÷ Êý Ö» ÄÜ Îª Õû ÐÍ ºÍ ×Ö ·û ÐÍ Êý ¾Ý ¡£
3.4.1²¹ Âë
Javaʹ Óà ²¹ Âë À´ ±í ʾ ¶þ ½ø ÖÆ Êý ,ÔÚ ²¹ Âë ±í ʾ ÖÐ ,×î ¸ß Î» Ϊ ·û ºÅ λ ,Õý Êý µÄ ·û ºÅ λ Ϊ 0,¸º Êý
Ϊ 1¡£ ²¹ Âë µÄ ¹æ ¶¨ Èç Ï :
¶Ô Õý Êý À´ ˵ ,×î ¸ß Î» Ϊ 0,Æä Óà ¸÷ λ ´ú ±í Êý Öµ ±¾ Éí (ÒÔ ¶þ ½ø ÖÆ ±í ʾ ),Èç +42µÄ ²¹ Âë Ϊ
00101010¡£
¶Ô ¸º Êý ¶ø ÑÔ ,°Ñ ¸Ã Êý ¾ø ¶Ô Öµ µÄ ²¹ Âë °´ λ È¡ ·´ ,È» ºó ¶Ô Õû ¸ö Êý ¼Ó 1,¼´ µÃ ¸Ã Êý µÄ ²¹ Âë ¡£ Èç
-42µÄ ²¹ Âë Ϊ 11010110 (00101010 °´ λ È¡ ·´ 11010101 +1 11010110 )
ÓÃ
Ïà¹ØÎĵµ£º
½ñÌìÒ»ÌìѧÁËÒì³£´¦ÀíÕâÒ»Õ¡£
Ê×ÏÈÒì³£ÊÇJava³ÌÐòÔÚÔËÐÐÆÚ³öÏֵĴíÎ󣬷DZàÒëÆÚ£¨javac£©³öÏֵĴíÎó¡£
È»ºóÔÙ¸øÒì³£·ÖÀ࣬Òì³£·ÖΪÈýÖÖ£¬µÚһΪerror£¬ÕâÖÖÒì³£²»¿ÉÒÔ´¦Àí£¬ÊÇϵͳµÄÄÚ²¿´íÎ󣬵ڶþΪException£¬ÕâÖÖ¿ÉÒÔ±»´¦Àí£¬ExceptionÀïÃæÓÖÓиöRuntimeExceptionµÄÀ࣬¶øRuntimeExceptionÓÖÊÇ¿ÉÒÔ²»±»²¶»ñ´¦ÀíµÄ£¬Òò ......
¼ÓÃܽâÃÜ£¬Ôø¾ÊÇÎÒÒ»¸ö±ÏÒµÉè¼ÆµÄÖØÒª×é¼þ¡£ÔÚ¹¤×÷Á˶àÄêÒÔºó»ØÏ뵱ʱÄǸö¼ÓÃÜ¡¢½âÃÜËã·¨£¬ÊµÔÚÊÇÌ«µ¥´¿ÁË¡£
ÑÔ¹éÕý´«£¬ÕâÀïÎÒÃÇÖ÷ÒªÃèÊöJavaÒѾʵÏÖµÄһЩ¼ÓÃܽâÃÜËã·¨£¬×îºó½éÉÜÊý×ÖÖ¤Êé¡£
Èç»ù±¾µÄµ¥Ïò¼ÓÃÜËã·¨£º
¡ñ BASE64 ÑϸñµØ˵£¬ÊôÓÚ±àÂë¸ñÊ ......
ΪÁË×öµ½Ê¹µÃ³ÌÐò¾ßÓиü¸ßµÄÁé»îÐÔ£¬¿ÉÅäÖÃÐÔ£¬ÔÚ¿ª·¢ÖÐÎÒÃǾ³£ÀûÓ÷´ÉäÀ´´´½¨Ò»¸öÀàµÄʵÀý£¬Ò²¾ÍÊÇ»ñµÃÒ»¸öÀàµÄÒ»¸ö¶ÔÏó£¡Í¨³£µÄ×ö·¨ÊÇͨ¹ýclass.newInstance»ñµÃ£»µ«ÕâÖÖ·½·¨ÓÐÒ»¸ö²»ºÃµÄµØ·½£¬ÄǾÍÊÇËûÖ»ÄÜ´´½¨Î޲ι¹ÔìÆ÷µÄ¶ÔÏó£¬Èç¹û¹¹ÔìÆ÷ÓвÎÊýÄÇËüÊÇÎÞÄÜΪÁ¦µÄ£»½â¾öµÄ·½·¨¾ÍÊÇ ÏÈͨ¹ý¸ÃÀàµÄClass»ñµÃ´øÓвΠ......
(Ò»)¹ýÂËÆ÷Àà±àд¡£
1¡¢ÉèÖÃ×Ö·û¼¯±àÂ뷽ʽ£º
±àд¹ýÂËÆ÷ÀࣺʵÏÖ½Ó¿Újavax.servlet.Filter
public class CharacterEncodingFilter implements Filter {
private String charset;
public void destroy() {
// TODO Auto-generated method stub
}
public void ......