JavaÖеÄʱ¼ä¾«¶È
ÔÚJavaÖпÉÒÔͨ¹ýSystem.currentTimeMillis()»òÕßSystem.nanoTime() (JDK>=5.0) ·½·¨»ñµÃµ±Ç°µÄʱ¼äµÄ¾«È·Öµ¡£µ«ÊÇͨ¹ýÔĶÁJavadoc£¬ÎÒÃÇ·¢ÏÖÕâÁ½¸ö·½·¨²¢²»Ò»¶¨±£Ö¤µÃµ½ÄãËùÆÚÍûµÄ¾«¶È¡£ÏÈÀ´¿´System.currentTimeMillis()£º
Returns the current time in milliseconds. Note that while the unit of time of
the return value is a millisecond, the granularity of the value depends on the
underlying operating system and may be larger. For example, many operating
systems measure time in units of tens of milliseconds.
³ÏÈçÉÏÃæËù˵·µ»ØÖµµÄÁ£¶ÈÒÀÀµÓڵײã²Ù×÷ϵͳ£¬ÄÇôËüÔÚ²»Í¬µÄƽ̨Éϵ½µ×ÄÜÌṩÊÇôÑùµÄ¾«¶È£¬ÊÇ·ñÏñº¯ÊýÃûËùдµÄÄÇÑùÕæÕý
¾«
È·µ½1ºÁÃëÄØ£¿¿´ÏÂÃæÒ»¶Î²âÊÔ³ÌÐò£º
public class ClockAccuracyTest {
public static void main(String args[]) {
SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss:SSS");
int size = 4000000;
// create an array to hold millisecond times
// and loop to capture them
long times[] = new long[size];
for (int i = 0; i < size; i++) {
times[i] = System.currentTimeMillis();
}
// now display the unique times
long time = times[0];
long previousTime = times[0];
long count = 0;
Set<Long> deltas = new HashSet<Long>();
long delta = 0;
long minDelta = Long.MAX_VALUE;
long maxDelta = Long.MIN_VALUE;
&
Ïà¹ØÎĵµ£º
ÀàÐÍת»»×ܽ᣺
1.ÔÐÍÊý¾Ýbyte,short,int,long,float,double,char,boolean,СÀàÐÍÊý¾Ý¿ÉÒÔÖ±½Ó¸³¸ø´óÀàÐÍÊý¾ÝÀýÈç
int a=1;byte b=2;short c=3;float d=3;double e=4;char f='a';boolean g=true;long l=10;
c=b;
a=f;
d=a;
e=d;
byteÐÍÊý¾Ý²»ÄÜÖ±½Ó¸³¸øcharÐÍÊý¾Ý£¬ÒòΪbyte±íʾµÄÊÇ8λÓзûºÅÊý£¬¶øchar±íʾµ ......
¶ÔÓÚÒ»¸öʵÏÖÁËComparable½Ó¿ÚµÄ¶ÔÏ󣬸ýӿÚÖ»ÄÜʵÏÖÒ»´Î¡£Èç¹ûÔÚÒ»¸ö¼¯ºÏÀïÃæÐèҪʹÓÃidÅÅÐò£¬¶øÔÚÁíÍâÒ»¸ö¼¯ºÏÀïÐèÒª°´Ãû×ÖÅÅÐòÕâʱ¾ÍÐèÒªÔÚÕâ¸ö¼¯ºÏÀïÃæÖ¸¶¨±È½ÏÆ÷¡£
Comparable½Ó¿ÚÉùÃ÷ÁËcompareTo(Object o)·½·¨
Comparator ½Ó¿ÚÉùÃ÷ÁËcompare(Object o1,Object o2)·½·¨
eg:
µÚÒ»¸öÊ÷¼¯Êǰ´ÕÕ¶ÔÏóĬÈϵÄidÅÅÐò£¬µ ......
ÔÌûµØÖ·http://blog.pfan.cn/txdnet/36493.html
Ò»,´Ó¸ù±¾ÉÏÈÏʶjava.lang.StringÀàºÍString³Ø
Ê×ÏÈ,ÎÒ½¨ÒéÏÈ¿´¿´StringÀàµÄÔ´ÂëʵÏÖ,ÕâÊÇ´Ó±¾ÖÊÉÏÈÏʶStringÀàµÄ¸ù±¾³ö·¢µã.´ÓÖпÉÒÔ¿´µ½:
1,StringÀàÊÇfinalµÄ,²»¿É±»¼Ì³Ð.public final class String.
2,StringÀàÊǵı¾ÖÊÊÇ×Ö·ûÊý×échar[], ²¢ÇÒÆäÖµ²»¿É¸Ä±ä.priva ......
̸̸»Øµ÷°É£¬ÒÔǰѧjavaµÄʱºò¾ÓȻû½Ó´¥µ½Õâ¸ö´Ê»ã£¬º¹£¬×î½üÑо¿hibernateºÍspring½áºÏʱ£¬·¢ÏÖspringʵÏÖhibernateʱӦÓÃÁ˻ص÷»úÖÆ£¬ÓÚÊÇgoogleÁ˺ܶà´Î£¬ÖÕÓÚÓÐËùÌå»áÁË£¬ÏÖÔÚ×öÏÂССµÄ×ܽᣬÒÔ±ã¼ÓÉîÓ¡Ïó£¡
java»Øµ÷»úÖÆ£º
Èí¼þÄ£¿éÖ®¼ä×ÜÊÇ´æÔÚ×ÅÒ»¶¨µÄ½Ó¿Ú£¬´Óµ÷Ó÷½Ê½ÉÏ£¬¿ÉÒÔ°ÑËûÃÇ·ÖΪÈý ......
¡¶javaÓïÑÔ³ÌÐòÉè¼Æ£¨Ò»£©¡·2009Äê×Ôѧ¿¼ÊÔ´ó¸ÙµÚ2ÕÂ
www.wesiedu.com 2009-5-5 ÔÚÏßÄ£Ä⿼³¡
µÚ2Õ ÔËËãºÍÓï¾ä
(Ò»)¿Î³ÌÄÚÈÝ
2.1 Êý¾ÝÔËËã
2.1.1 ¸³ÖµÔËËã
2.1.2ËãÊõÔËËã
2.1.3×ÔÔöºÍ×Ô¼õÔËËã
2.1.4¹ØÏµÔËËã
2.1.5Âß¼ÔËËã
2.1.6Ìõ¼þÔËËã
2.1.7ÆäËûÔËËã
2.2Óï¾ä
2.2.1»ù±¾Óï¾ä
2.2 ......