Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ :

JavaÈÕÆÚ¸ñʽ»¯³£Ó÷½·¨

JavaÖÐDateÀàÖеÄһЩÈÕÆÚ¸ñʽ»°·½·¨¶¼ÒѹýÆÚ£¬ËùÒÔ²»ÍƼöʹÓá£
Ò»°ã¸ñʽ»¯Ê±£¬³£Óõ½ÕâÁ½¸öÀࣺCalendar
ºÍSimpleDateFormat
£¬Ê¹Ó÷½·¨ÈçÏ£º
1.CalendarÀà
CalendarÀàÊÇabstractµÄ£¬ËùÒÔʵÀý»¯·½Ê½µÃÓþ²Ì¬·½·¨£º
Calendar c = Calendar.getInstance();£¬
´ËʱµÄÉú³ÉµÄʵÀýÒÀ¾ÝµÄÊǵ±Ç°ÏµÍ³Ê±¼ä£»c.setTime(java.util.Date date)¿ÉÒÔÉ趨Ï붨µÄʱ¼ä¡£
Àý£©
Date date = rs.getDate("hiredate");
Calendar ca = Calendar.getInstance();
ca.setTime(date);
System.out.print(ca.get(Calendar.MONTH) + 1
2.SimpleDateFormatÀà
Date date = rs.getDate("hiredate");
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.applyPattern("yyyy/MM/dd HH:mm:ss");
System.out.println(sdf.format(date));
 
......

java ´®¿Ú±à³Ì Ò»

1. SerialBean
SerialBeanÊDZ¾Àà¿âÓëÆäËûÓ¦ÓóÌÐòµÄ½Ó¿Ú¡£¸ÃÀà¿âÖж¨ÒåÁËSerialBeanµÄ¹¹Ôì·½·¨ÒÔ¼°³õʼ»¯´®¿Ú£¬´Ó´®¿Ú¶ÁÈ¡Êý¾Ý£¬Íù´®¿ÚдÈëÊý¾ÝÒÔ¼°¹Ø±Õ´®¿ÚµÄº¯Êý¡£¾ßÌå½éÉÜÈçÏ£º
public SerialBean(int PortID)
±¾º¯Êý¹¹ÔìÒ»¸öÖ¸ÏòÌض¨´®¿ÚµÄSerialBean£¬¸Ã´®¿ÚÓɲÎÊýPortIDËùÖ¸¶¨¡£PortID = 1 ±íʾCOM1£¬PortID = 2 ±íʾCOM2£¬ÓÉ´ËÀàÍÆ¡£
public int Initialize()
±¾º¯Êý³õʼ»¯ËùÖ¸¶¨µÄ´®¿Ú²¢·µ»Ø³õʼ»¯½á¹û¡£Èç¹û³õʼ»¯³É¹¦·µ»Ø1£¬·ñÔò·µ»Ø-1¡£³õʼ»¯µÄ½á¹ûÊǸô®¿Ú±»SerialBean¶ÀÕ¼ÐÔʹÓã¬Æä²ÎÊý±»ÉèÖÃΪ9600, N, 8, 1¡£Èç¹û´®¿Ú±»³É¹¦³õʼ»¯£¬Ôò´ò¿ªÒ»¸ö½ø³Ì¶ÁÈ¡´Ó´®¿Ú´«ÈëµÄÊý¾Ý²¢½«Æä±£´æÔÚ»º³åÇøÖС£
public String ReadPort(int Length)
±¾º¯Êý´Ó´®¿Ú(»º³åÇø)ÖжÁÈ¡Ö¸¶¨³¤¶ÈµÄÒ»¸ö×Ö·û´®¡£²ÎÊýLengthÖ¸¶¨Ëù·µ»Ø×Ö·û´®µÄ³¤¶È¡£
public void WritePort(String Msg)
±¾º¯ÊýÏò´®¿Ú·¢ËÍÒ»¸ö×Ö·û´®¡£²ÎÊýMsgÊÇÐèÒª·¢Ë͵Ä×Ö·û´®¡£
public void ClosePort()
±¾º¯ÊýÍ£Ö¹´®¿Ú¼ì²â½ø³Ì²¢¹Ø±Õ´®¿Ú¡£
package serial;
 import java.io.*;
 import java.util.*;
 import javax.comm.*;
 /**
  *
  * This bean provides some ......

Çë¾ýÈëÎÌ£¬Ô¶ÀëJavaÕä°®ÉúÃü£¡JavaµÄµÍ³É±¾Æ­¾Ö

       ¿´µ½Ô°×ÓµÄͬÁÅÃÇдµÄ¡¶¿çƽ̨¡·ÏµÁÐÖ®ºóÕæµÄÊÇÈÈѪ·ÐÌÚ£¬ÓÐЩ»°²»µÃ²»Ëµ£¬²»Äܲ»Ëµ¡£ÎÒÒª½ÒµôJavaÕâÒ»²ã²ãÃÀÀöµÄ“»­Æ¤”,Èôó¼Ò¿´¿´»­Æ¤Ö®ÏÂÊÇʲô£¿ÎÒÃÇ¿´µ½µÄ¶¼ÊÇһЩʲô£¿ÎÒ±¾È˲¢²»ÊÇÒ»¶¨µÃÍƼö´ó¼ÒÓÃ.NETƽ̨£¬µ«ÊÇÎÒ¾ÍÊÇ¿´²»¹ÜÓÐЩÈËÎóµ¼³õѧÕߣ¬ÏòËûÃÇ´«µ¼Ê²Ã´¶¼µÃÓÃJavaд£¬Ê²Ã´¶¼ÊÇJava×îÅ£B¡£ÎÒÈÏΪӦ¸Ã¸ù¾ÝÏîÄ¿µÄÒªÇó¶øÑ¡Ôñƽ̨Ó뿪·¢ÓïÑÔ£¬±ÈÈç×öC/S¿ª·¢Ñ¡Ôñ.NET¾ø¶ÔÊÇÃ÷Öǵģ¬Èç¹ûÄúÐèÒª¿çƽ̨Äú¿ÉÒÔÑ¡ÓÃQTÖ®ÀàµÄ£¬¸ÉÂïÆ«Æ«ÓÃSwingÄÄ£¿Ò²ÐíÓÃSWingÄÜÏԵóöËû±È±ðÈËÅ££¿×öWEB¿ª·¢Ñ¡ÔñPHPÓ¦¸ÃÒ²ÊÇÃ÷ÖǵÄÑ¡Ôñ£¬¾ý²»¼ûÊÀ½çÉÏÁ½¸öÍøÕ¾Ö®Ò»FaceBook¾ÍÊÇÓÃPHPµÄÂ𣿲ÉÓÃPHP·½±ã¿ì½Ý¿ª·¢Ëٶȿ죬²¿Ê𷽱㡣ÓеÄʱºòÎÒ¶¼ºÍ±ðÈË˵ASP.NETºÍPHPÕâ¸öСÐֵܱÈÆðÀ´Ò²²î²»ÉÙÄÄ£¬µ«ÄãÓÃJavaÀ´¿ª·¢£¿ºÇºÇºÇ¡£¡£ÄãÄܳԶàÉÙ¿àÎÒÏëÖ»ÓÐÄã×ÔÒÑÄÜÖªµÀ°É¡£ºÃÁË·Ï»°ÉÙ˵£¬ÎÒÃÇÀ´½Ò“»­Æ¤”°É
»­Æ¤Ö®Ò»£ºJavaµÄµÍ³É±¾
       JavaµÄµÍ³É±¾ÄѵÀÕæµÄºÜµÍÂð£¿ÊÀ½çûÓÐÎÚÍа´ó¼Ò¶¼Òª³Ô·¹ÄÄ£¬±ð×öÃÎÁË£¡
       Ê×ÏÈÎÒÃÇÏÈÌÖÂÛËüµÄ·þÎñÆ÷£¬ºÜ¶àÈË¿ÉÄܺܿì¾Í¸ ......

JavaÐòÁл¯¼òÃ÷¸ÅÒª

1. ¸ÅÄ ÐòÁл¯¾ÍÊǰѶÔÏó±ä³É¶ÔÏóÁ÷£¨È·ÇÐ˵ÊǰѶÔÏóµÄÊôÐÔдÈëÁ÷£©£¬Èç¹ûÐèÒª½ø¶ø¿ÉÒ԰ѶÔÏóÁ÷´æ³É¶þ½øÖÆÎļþ£»
2. Ä¿µÄ£º ÐòÁл¯µÄÄ¿µÄÊÇΪÁË·½±ãÓÀ¾Ã´æ´¢»òÕßÍøÂç´«Ê䣻
3. ÈçºÎʵÏÖ£º ½«ÀàʵÏÖSerializable½Ó¿Ú¼´¿É£¬ÎÞ±ØÐëʵÏֵķ½·¨£¬ÊµÏָýӿÚÖ»ÊÇΪÁ˱êʶ¸ÃÀà¿É±»ÐòÁл¯£»
4. £¨×ª£©ÆäËûÐèÒªÖªµÀµÄ£º
  Ò»¡¢ÔÚ¿ÉÐòÁл¯ÀàÖÐÒª¶¨ÒåserialVersionUID£»
  ¶þ¡¢±êʶ²»ÐèÒªÐòÁл¯µÄ³ÉÔ±£¬¿ÉÒÔʹÓÃtransient¹Ø¼ü×Ö£»
  Èý¡¢ÓÃÀ´±»¼Ì³ÐµÄÀ࣬¾¡Á¿²»ÊµÏÖSerializable£¬ÓÃÀ´±»ÊµÏÖµÄinterfaceÒ²²»Òª¼Ì³ÐSerializable¡£Èç¹û¸¸À಻ʵÏÖSerializable½Ó¿Ú£¬×ÓÀàºÜÄÑʵÏÖËü£¬ÌرðÊǶÔÓÚ¸¸ÀàûÓÐÎ޲ι¹Ô캯ÊýµÄʱºò¡£ËùÒÔ£¬²»ÊµÏÖSerializable½Ó¿ÚÇҿɱ»¼Ì³ÐµÄÀ࣬ÇÒ×ÓÀàÐëÐòÁл¯ÊÇ£¬ÐèÒªÌṩһ¸öÎÞ²ÎÊý¹¹Ô캯Êý¡£ ......

javaλ²Ù×÷·ûµÄ×ܽá


ת×Ô£ºhttp://www.itwis.com/html/java/j2se/20090223/3407.html
ÒÔÏÂÊÇjavaλ²Ù×÷·ûµÄС×ܽᣬ¾ßÌåÈçÏ£º
¶þ½øÖƸºÊýÒÔËüÕýÖµµÄ²¹ÂëÐÎʽ±í´ï
²¹Â룺·´Âë+1µÈÓÚ²¹Âë
±ÈÈ磺System.out.println(Integer.toBinaryString(-5));
´òÓ¡£º1111 1111 1111 1111 1111 1111 1111 1011  ²»ÓÃÏëÁ˿϶¨ÊÇ32λ
¹ý³ÌÊÇÕâÑùµÄ£º
Ò»¸ö¸ºÊý£¬±ÈÈç-5£¬ËüµÄ¶þ½øÖÆÔÚjavaÀïÃæÊÇÕâÑù±íʾ
1000 0000 0000 0000 0000 0000 0000 0101
ËüµÄÕýÖµÊÇ£º
0000 0000 0000 0000 0000 0000 0000 0101
·´ÂëÊÇ£º
1111 1111 1111 1111 1111 1111 1111 1010
ÔÙ¼ÓÉÏ1ÊÇ£º
1111 1111 1111 1111 1111 1111 1111 1011
¼´µÃµ½´òÓ¡µÄÄÚÈÝ
java ~ ²Ù×÷·û£¬¶Ôÿ¸ö¶þ½øÖÆλµÄÄÚÈÝÇó·´£¬¼´1±ä³É0£¬0±ä³É1
²âÊÔ¸ºÊý£º
int a = -5;//101;
System.out.println(~a);
´òÓ¡£º4
¹ý³ÌÊÇÕâÑùµÄ£¬Ê×Ïȱíʾ³öÀ´Õâ¸ö¸ºÊý
1111 1111 1111 1111 1111 1111 1111 1011£¨ÉÏÃæÒѾ­ÌᵽΪʲôÕâÑù±íʾ£©
¸÷λȡ·´µÃµ½
0000 0000 0000 0000 0000 0000 0000 0100
תΪ10½øÖƵõ½4
²âÊÔÕýÊý:
int a = 5;//101;
System.out.println(~a);
´òÓ¡£º-6
Ê×Ïȱíʾ³öÀ´Õâ¸öÕýÊý£º
0000 0000 0000 0000 0000 0000 0000 01 ......

Java ¶àÏß³Ìͬ²½ÎÊÌâµÄ̽¾¿£¨Ò»¡¢Ï̵߳ÄÏÈÀ´ºóµ½£©

ÖÚËùÖÜÖª£¬ÔÚJava¶àÏ̱߳à³ÌÖУ¬Ò»¸ö·Ç³£ÖØÒªµÄ·½Ãæ¾ÍÊÇÏ̵߳Äͬ²½ÎÊÌâ¡£
¹ØÓÚÏ̵߳Äͬ²½£¬Ò»°ãÓÐÒÔϽâ¾ö·½·¨£º
1. ÔÚÐèҪͬ²½µÄ·½·¨µÄ·½·¨Ç©ÃûÖмÓÈësynchronized¹Ø¼ü×Ö¡£
תÔØ×¢Ã÷³ö´¦£ºhttp://x- spirit.javaeye.com/¡¢http: //www.blogjava.net/zhangwei217245/
2. ʹÓÃsynchronized¿é¶ÔÐèÒª½øÐÐͬ²½µÄ´úÂë¶Î½øÐÐͬ²½¡£
תÔØ×¢Ã÷³ö´¦£ºhttp://x- spirit.javaeye.com/¡¢http: //www.blogjava.net/zhangwei217245/
3. ʹÓÃJDK 5ÖÐÌṩµÄjava.util.concurrent.lock°üÖеÄLock¶ÔÏó¡£
תÔØ×¢Ã÷³ö´¦£ºhttp://x- spirit.javaeye.com/¡¢http: //www.blogjava.net/zhangwei217245/
ÁíÍ⣬ΪÁ˽â¾ö¶à¸öÏ̶߳Ôͬһ±äÁ¿½øÐзÃÎÊʱ¿ÉÄÜ·¢ÉúµÄ°²È«ÐÔÎÊÌ⣬ÎÒÃDz»½ö¿ÉÒÔ²ÉÓÃͬ²½»úÖÆ£¬¸ü¿ÉÒÔͨ¹ýJDK 1.2ÖмÓÈëµÄThreadLocalÀ´±£Ö¤¸üºÃµÄ²¢·¢ÐÔ¡£
±¾ÆªÖУ¬½«ÏêϸµÄÌÖÂÛJava¶àÏß³Ìͬ²½»úÖÆ£¬²¢¶ÔThreadLocal×ö³ö̽ÌÖ¡£
´óÖµÄĿ¼½á¹¹ÈçÏ£º
Ò»¡¢Ï̵߳ÄÏÈÀ´ºóµ½——ÎÊÌâµÄÌá³ö£ºÎªÊ²Ã´ÒªÓжàÏß³Ìͬ²½£¿Java¶àÏß³Ìͬ²½µÄ»úÖÆÊÇʲô£¿
¶þ¡¢¸øÎÒÒ»°ÑËø£¬ÎÒÄÜ´´ÔìÒ»¸ö¹æ¾Ø——´«Í³µÄ¶àÏß³Ìͬ²½±à³Ì·½·¨ÓÐÄÄЩ£¿ËûÃÇÓкÎÒìͬ£¿
Èý¡¢LockÀ´ÁË£¬´ó¼Ò¶¼Èÿª&m ......
×ܼǼÊý:40319; ×ÜÒ³Êý:6720; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [17] [18] [19] [20] 21 [22] [23] [24] [25] [26]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ