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

Java XStream·â×°Àà

´Ë¸öÀàÊÇΪÁË·½±ã³õѧÕß¶ÔXMLµ½ javabean µÄÏ໥ת»»²»ÊìϤ¶øÐ´µÄ:
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
public class XmlBean {
 /*
  * @AUTHOR:ZHONG
  * @CREATETIME:2010/02/10
  * @PREAM:OBJECT(JAVABEAN)
  * @RETURN:XML STRING
  */
 public static String GenerateXML(Object model){
  
  XStream xstream = new XStream(new DomDriver());
  //ת»»³É xml ¸ñʽ  
  String xml = xstream.toXML(model);
  return xml;
 }
 /*
  * @AUTHOR:ZHONG
  * @CREATETIME:2010/02/10
  * @PREAM:STRING(XML)
  * @RETURN:(javabean)OBJECT
  */
 public static Object fromXML(String xmlString){
  XStream xs = new XStream(new DomDriver());
     Object ob = xs.fromXML(xmlString);
     System.out.println(ob);
     return ob;
 }
ʹÓÃʵÀý:
public static void main(String[] args) {
  
  UserBean user = new UserBean();
  user.setUsername("zhongshulin");
  user.setPassword("123456");
  user.setEmail("zhong@shulin.com");
  user.setPhone("123456789");
  user.setAddress("Ö麣ƷÉÐ");
  String xml = GenerateXML(user);
  user =(UserBean)fromXML(xml);
  String  userName = user.getUsername();
  String  pass = user.getPassword();
  String  email = user.getEmail();
  String  phone = user.getPhone();
  String address = user.getAddress();
  
 }


Ïà¹ØÎĵµ£º

Java¶¨Ê±ÈÎÎñµÄʵÏÖ

¢Ù¼Ì³ÐTimerTask£¬ÖØÐ´run·½·¨
package bamboo.task;
import java.util.TimerTask;
public class TimeTaskTest extends TimerTask{
 @Override
 public void run() {
  System.out.println("hi");
 }
}
¢Úͨ¹ýtimerÀ´ÉèÖÃij¸öʱ¼äÀ´µ÷Ó㬻òÕßÊÇÏà¸ô¶à³¤Ê±¼äµ÷ÓÃ
package bamboo.test; ......

Java·´ÉäÖÐMethodÀàinvoke·½·¨µÄÓ÷¨

/**
* InvokeTester.java
* °æÈ¨ËùÓÐ(C) 2010 cuiran2001@163.com
* ´´½¨:´ÞȽ 2010-2-9 ÏÂÎç02:07:13
*/
package com.timer.demo.objectsocket;
import java.lang.reflect.Method;
/**
* @author ´ÞȽ
*
*/
public class InvokeTester {
public int add(int param1, int param2) {
return param ......

javaÎļþºÍÎļþ¼ÐµÄ²Ù×÷

import java.io.BufferedReader;  
import java.io.File;  
import java.io.FileInputStream;  
import java.io.FileOutputStream;  
import java.io.FileWriter;  
import java.io.IOException;  
import java.io.InputStream;  
im ......

Java À¬»ø»ØÊÕ µ÷ÓÅ HotSpot JV

ÒýÑÔ
ÓÐJAVA¿ª·¢¾­ÑéµÄÅóÓÑÃÇÒ»¶¨Åöµ½¹ýÏÂÃæµÄÕâÖÖÇé¿ö,ÄǾÍÊÇ×Ô¼ºËù¿ª·¢µÄÓ¦ÓÃÔËÐÐÁËÒ»¶Îʱ¼äºóÆäÐÔÄÜ»ò ÕßÏìÓ¦ËÙ¶È»áÓÐÃ÷ÏԵĽµµÍ.ÕâÊÇÓÉ¶à·½ÃæµÄÔ­ÒòÔì³ÉµÄ¼´ÓгÌÐò±¾ÉíµÄÓÅ»¯ÎÊÌâ,Ò²ÓÐÔËÐл·¾³ÎÊÌâ.´ËÔËÐл·¾³¼´°üÀ¨Ó²¼þ»·¾³Ò²°üÀ¨Èí¼þ»·¾³.´ó¶àÊýÈ˵ÚÒ» ¸öÄÜÏëµ½µÄ½â¾ö·½·¨ÊÇÌáÉýÓ²¼þµÄÅäÖöøºöÂÔÁ˳ÌÐò±¾ÉíµÄÔËÐл·¾ ......

Ò»µÀ¼òµ¥µÄjavaÌ⣬ȷ·ÑÁËÎÒͦ³¤Ê±¼äµÄ¡£

½ñÈÕÔÚÍøÉÏżȻÅöµ½Ò»¸ö³õѧÕßµÄjavaÌâÄ¿£¬¾Í³¢ÊÔµÄ×öÁËһϣ¬µ«Ã»Ïëµ½Ò»×ö¾ÍÊǽӽüÒ»¸öÖÓÍ·°¡£¬¿´À´javaѧϰµÄ·ÉÏ»¹ÊÇ·ÂþÂþÙâÐÞÔ¶°¡¡£
 ÌâÄ¿ÈçÏ£º
±àдһ¸öJava Application ³ÌÐò£¬½ÓÊÜÓû§ÊäÈëµÄÒ»¸ö¸¡µãÊý£¬½«ÆäµÄÕûÊý²¿·ÖºÍСÊý²¿·Ö·Ö±ðÊä³ö¡£
È磺ÊäÈë56.6 £¬ÔòÓÐ
¡¡¡¡¡¡¡¡¡¡¡¡ÕûÊý²¿·Ö£º56
¡¡¡¡¡¡¡¡¡¡¡¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ