JAVA¶ÁÊé±Ê¼Ç£¨¶þ£©
²Ù×÷·û
1.λ²Ù×÷·û
(a) >>>ÓÒÒÆ£¬¸ßλÓÃ0Ìî³ä£»
int a = 14;
int b = 2;
System.out.println(a >>> b);// 3
int c = -14;
int d = 2;
System.out.println(c >>> d);// 1073741820
(b) >>·ûºÅλ²»±ä£¬ÆäËûλÓÒÒÆ£¬¸ßλÓÃ0Ìî³ä£¬Æä½á¹ûÓëa/2bÏàͬ£»
int a = 14;
int b = 2;
System.out.println(a >> b);// 3
int c = -14;
int d = 2;
System.out.println(c >> d);// -4
System.out.println(Math.floor(a / Math.pow(2, b))); // 3.0
System.out.println(Math.floor(c / Math.pow(2, d))); // -4.0
(c) <<·ûºÅλ²»±ä£¬ÆäËûλ×óÒÆ£¬µÍλÓÃ0Ìî³ä£¬Æä½á¹ûÓëa×2bÏàͬ£»
int a = 14;
int b = 2;
System.out.println(a << b);// 56
int c = -14;
int d = 2;
System.out.println(c << d);// -56
System.out.println(Math.floor(a * Math.pow(2, b))); // 56.0
System.out.println(Math.floor(c * Math.pow(2, d))); // -56,0
(d) ¶ÔÓÚjava.util.MathÖеÄceil¼°floorº¯Êý£¬Òª×¢Òâ²ÎÊýµÄÀàÐÍ
int a = 14;
int b = 3;
System.out.println(Math.floor(a / b)); // 4
System.out.println(Math.ceil(a / b)); // 4
double c = 14d;
double d = 3d;
System.out.println(Math.floor(c / d)); // 4
System.out.println(Math.ceil(c / d)); // 5
ÈçÉÏËùʾ£ºÓÉÓÚaºÍbÁ½¸ö²ÎÊý¶¼ÊÇintÀàÐ͵ģ¬Òò´ËÔÚÖ´ÐÐa/bºó£¬»á×öÒ»¸öÒþʽµÄÀàÐÍת»»£¬½«½á¹ûת³ÉintÀàÐ͵ģ¬ÕâÑù¾Í»á½«Ð¡ÊýλÉáÆú¡£Òò´ËÔÚÓõ½ceilºÍfloorº¯Êýʱ£¬Ó¦¸Ã×¢Òâ±í´ïʽ¼ÆËãºóËùÉú³ÉµÄ½á¹ûµÄÊý¾ÝÀàÐÍ¡£
Ïà¹ØÎĵµ£º
1.final¹Ø¼ü×ÖÐÞÊÎÀàʱ£¬ËµÃ÷ÆäÀ಻ÄÜÓÐ×ÓÀ࣬Ҳ¾ÍÊÇ˵¸ÃÀ಻Äܱ»¼Ì³Ð£¬¸ÃÀàµÄ³ÉÔ±±äÁ¿ÔÚÕâÀォ²»Æð×÷Óá£
2.final¹Ø¼ü×ÖÐÞÊη½·¨Ê±£¬ËµÃ÷¸Ã·½·¨²»Äܱ»ÖØд£¬ÒòΪÀ඼²»Äܱ»¼Ì³ÐÁË£¬·½·¨¾Í¸ü²»ÄÜÖØдÁË¡£
3.ÀàÀï¿ÉÒÔº¬ÓÐfinal¹Ø¼ü×ÖÐÞÊεķ½·¨¡£
4.ÔÚjavaÀ³éÏóÀà×îÉÙÒªº¬ÓÐÒ»¸ö³éÏó·½·¨£¬ÈÃËüµÄ×ÓÀàȥʵÏÖÕâ¸ö³éÏó·½· ......
import java.util.Enumeration;
public class CipherTest implements Enumeration {
private int N;
private int c[], k;
private Object[] objs;
public CipherTest(Object[] items) {
N = items.length;
c = new int[N + 1];
for (int i = 0; i <= N; i++)
c[i] = i;
objs = items;
k = 1 ......
1¡¢ÃæÏò¶ÔÏóµÄÌØÕ÷ÓÐÄÄЩ·½Ãæ
1.³éÏ󣺳éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
2.¼Ì³Ð£º¼Ì³ÐÊÇÒ»ÖÖÁª½áÀàµÄ²ã´ÎÄ£ÐÍ£¬²¢ÇÒÔÊÐíºÍ ......
±¾ÆªÎÄÕÂÀ´Ô´ÓÚ£º¿ª·¢Ñ§Ôº http://edu.codepub.com ÔÎÄÁ´½Ó£ºhttp://edu.codepub.com/2010/0221/20469.php
½Ó¿ÚÉêÃ÷±ØÐëÓÐinterface¹Ø¼ü×ֺͽӿڵÄÃû×Ö£¬publicÖ¸Ã÷ÈÎÒâÀà¾ù¿ÉÒÔʹÓÃÕâ¸ö½Ó¿Ú£¬Ä¬ÈÏÇé¿öÏ£¬Ö»ÓÐÓë¸Ã½Ó¿Ú¶¨ÒåÔÚͬһ¸ö°üÖеÄÀà²Å¿ÉÒÔ·ÃÎÊÕâ¸ö½Ó¿Ú¡£extends ÓëÀà ......
ÔÚ¿Í»§/·þÎñÆ÷ͨÐÅģʽÖУ¬¿Í»§¶ËÖ÷¶¯´´½¨Óë·þÎñÆ÷Á¬½ÓµÄSocket£¬·þÎñÆ÷ÊÕµ½¿Í»§¶ËµÄÁ¬½ÓÇëÇó£¬Ò²´´½¨ÁËÓë¿Í»§¶ËÁ¬½ÓµÄSocket¡£
¿Í»§¶ËÖ÷¶¯´´½¨Socketʱºò£¬ÐèÒª×öÏÂÃæһЩÊÂÇ飺
1. ¹¹ÔìSocket.
2. É趨µÈ´ý½¨Á¢Á¬½ÓµÄ³¬Ê±Ê±¼ä
&nb ......