Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JAVAϵÁÐÖ®¶ÔÏóµÄÐòÁл¯Óë·´ÐòÁл¯

±¾ÎÄÀ´×Ô£ºhttp://www.javaeye.com/topic/130025   1 ¼ò½é<o:p></o:p> ¶ÔÏóÐòÁл¯(Serializable)ÊÇÖ¸½«¶ÔÏóת»»Îª×Ö½ÚÐòÁеĹý³Ì£¬¶ø·´ÐòÁл¯ÔòÊǸù¾Ý×Ö½ÚÐòÁлָ´¶ÔÏóµÄ¹ý³Ì¡£<o:p></o:p> ÐòÁл¯Ò»°ãÓÃÓÚÒÔϳ¡¾°£º<o:p></o:p> 1. ÓÀ¾ÃÐÔ±£´æ¶ÔÏ󣬱£´æ¶ÔÏóµÄ×Ö½ÚÐòÁе½±¾µØÎļþÖУ»<o:p></o:p> 2. ͨ¹ýÐòÁл¯¶ÔÏóÔÚÍøÂçÖд«µÝ¶ÔÏó£»<o:p></o:p> 3. ͨ¹ýÐòÁл¯ÔÚ½ø³Ì¼ä´«µÝ¶ÔÏó¡£<o:p></o:p> ¶ÔÏóËùÊôµÄÀà±ØÐëʵÏÖSerializable»òÊÇExternalizable½Ó¿Ú²ÅÄܱ»ÐòÁл¯¡£¶ÔʵÏÖÁËSerializable½Ó¿ÚµÄÀ࣬ÆäÐòÁл¯Óë·´ÐòÁл¯²ÉÓÃĬÈϵÄÐòÁл¯·½Ê½£¬Externalizable½Ó¿ÚÊǼ̳ÐÁËSerializable½Ó¿ÚµÄ½Ó¿Ú£¬ÊǶÔSerializableµÄÀ©Õ¹£¬ÊµÏÖÁËExternalizable½Ó¿ÚµÄÀàÍêÈ«×Ô¼º¿ØÖÆÐòÁл¯Óë·´ÐòÁл¯ÐÐΪ¡£<o:p></o:p> Java.io.ObjectOutputStream´ú±í¶ÔÏóÊä³öÁ÷£¬Æä·½·¨writeObject(Object obj)¿ÉÒÔʵÏÖ¶ÔÏóµÄÐòÁл¯£¬½«µÃµ½µÄ×Ö½ÚÐòÁÐдµ½Ä¿±êÊä³öÁ÷ÖС£Java.io.ObjectInputStream´ú±í¶ÔÏóÊäÈëÁ÷£¬ÆäreadObject()·½·¨ÄÜ´ÓÔ´ÊäÈëÁ÷ÖжÁÈ¡×Ö½ÚÐòÁУ¬½«Æä·´ÐòÁл¯Îª¶ÔÏ󣬲¢½«Æä·µ»Ø¡£<o:p></o:p> <o:p> </o:p> 2 ÐòÁл¯µÄ¼¸ÖÖ·½Ê½<o:p></o:p> ¼ÙÉ趨ÒåÁËÒ»¸öCustomerÀ࣬¸ù¾ÝCustomerʵÏÖÐòÁл¯·½Ê½µÄ²»Í¬£¬¿ÉÄÜÓÐÒÔϼ¸ÖÖÐòÁл¯·½Ê½£º<o:p></o:p> 2.1 ʵÏÖSerializable,䶨ÒåreadObjectºÍwriteObject·½·¨<o:p></o:p> Ø ObjectOutputStreamʹÓÃJDKĬÈÏ·½Ê½¶ÔCustomer¶ÔÏóµÄ·ÇtransientµÄʵÀý±äÁ¿½øÐÐÐòÁл¯£»<o:p></o:p> Ø ObjectInputStreamʹÓÃJDKĬÈÏ·½Ê½¶ÔCustomer¶ÔÏóµÄ·ÇtransientµÄʵÀý±äÁ¿½øÐз´ÐòÁл¯¡£<o:p></o:p> <o:p> </o:p> 2.2 ʵÏÖSerializable,²¢¶¨ÒåÁËreadObjectºÍwriteObject·½·¨<o:p></o:p> Ø ObjectOutputStreamµ÷ÓÃCustomerÀàµÄwriteObject(ObjectOutputStream out)·½·¨¶ÔCustomer¶ÔÏóµÄ·ÇtransientµÄʵÀý±äÁ¿½øÐÐÐòÁл¯£»<o:p></o:p> Ø ObjectInputStreamµ÷ÓÃCustomerÀàµÄreadObject(ObjectInputStream in)·½·¨¶ÔCustomer¶ÔÏóµÄ·ÇtransientµÄʵÀý±äÁ¿½øÐз´ÐòÁл¯¡£<o:p></o:p> 2.3 ʵÏÖExternalizable,¶¨ÒåreadExternalºÍwriteExternal·½·¨<o:p></o:p&g


Ïà¹ØÎĵµ£º

×Ô¶¨ÒåJavaÒì³£

1.Ç°ÑÔ£º
ÄãµÄ³ÌÐò×ÜÓÐÒ»Ìì»á±ÀÀ£µô£¬ÔÚ±ÀÀ£µôµÄʱºòÎÒÃÇÒªÖªµÀËüÔÚÄÄ£¬ÎªÁËʲô¶ø±ÀÀ£µô£¬Êý¾ÝµÄ±£´æ»òÕ߶ªÊ§Çé¿öÈçºÎµÈÎÊÌâ¡£ÎÒÃÇ¿ÉÒÔͨ¹ý¼Ì³ÐÀàjava.lang.ThrowableµÄ×ÓÀࣺExceptionÀ´Éè¼ÆÎÒÃÇ×Ô¼ºµÄJavaÒì³£¡£ExceptionÀàÓÃÓÚÃèÊö³ÌÐòÄܹ»²¶»ñµÄÒì³££¬ÈçClassNotFoundException¡£Òª×¢ÒâµÄÊÇ×Ô¶¨ÒåÒì³£ÀàÖ®¼äÒ²¿ÉÒÔÓм ......

Java Éè¼Æģʽ(12)

Observer
Intent
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
How to
Subject
  
knows its observers. Any number of Observer objects may observe a subject.
  
provides an in ......

ÎÒºÍJavaµÄһЩÍùÊÂ

     ´ó¼ÒÖªµÀ£¬ÔÚ1991Ä꣬¼¸ºõÓëLinuxͬʱ£¬SUN·¢²¼ÁËJava±à³ÌÓïÑÔ¡£²»¾Ã£¬ÎҵĴóѧͬѧ£¨±ÈÎÒµÍÁ½Ä꣩Íõ¿Ëºê½ÌÊÚ£¨Ç廪²©Ê¿µ¼Ê¦£©ÓëSUNºÏ×÷³ÉÁ¢ÁËÖйú×îÔçµÄ“JavaÑо¿ÖÐÐÄ”£¬²¢ÇÒµ£ÈθÃÖÐÐÄÖ÷ÈΡ£´Ó´Ë£¬ÎÒ¿ªÊ¼×¢ÒâJava¼¼ÊõµÄ·¢Õ¹¶¯Ì¬¡£ÎÒ¼ÒÖеĴæÊ飬ÒÔJavaÊé¼®×î¶à£¨µ±È»£¬³ýÁËÊýѧÊé¼® ......

java jdbc Á¬½ÓOracle9i

     ×Ô¼ºÔÚ×öÕâ¸ö³ÌÐòµÄʱºò¿´¹ýºÜ¶àµÄ×ÊÁÏ£¬ÉÏÍøÒ²²éÁ˲»ÉÙµÄ×ÊÁÏ£¬¿ÉÊǶà°ë˵µÄÊdzöÉñÈ뻯£¬ÔÆÀïÎíÀï...²»¹â¿´Á˲»Ã÷°×£¬¶øÇÒÊÇÓÐÃ÷°×Ò»µãµÄÈË£¬¿´ÁËÒ²±äµÄÓÐЩģºýÁË¡£
     ÕâÀïÎÒÑÚÊÎÒ»Ì×ÍêÕûµÄjava jdbc Á¬½ÓOracle9iµÄ·¶Àý¡£
package com.lxh.dbcon;//´ò°ü
import ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ