import java.util.*;
import java.text.*;
public class Test {
   public static void main(String[] args)
   {
    
//*****************引用传递与值传递;******************************
    
 /*  int x=9;
    int y=x;
    System.out.println("x is :"+x);
    y=7;
    System.out.println("y is :"+y);
    System.out.println("x is :"+x);
    Date dd=new Date();
    dd.getDate();
    Date bb=dd;
    System.out.println("d is :"+dd);
    bb.setDate(11);
    System.out.println("d is :"+dd);*/
    
    
    
  /* System.out.println("hello java");
 
*****************************Vector类使用;******************
   Vector rec=new Vector();
   rec.add("1");
   rec.add("2");
   rec.add("3");
   rec.add("5");
   
   rec.add("4");
 /*   for(int i=0;i<rec.size();i++)
   {
     System.out.println(rec.get(i));
   }
    rec.remove("3");
    rec.remove(3);
    
    
***************StringBuffer和Vector 的使用;****************************
*
*
    StringBuffer sb1=new StringBuffer();
    StringBuffer sb2=new StringBuffer();
    StringBuffer sb3=new StringBuffer();
    StringBuffer sb4=new StringBuffer();
    StringBuffer sb5=new StringBuffer();
    
       sb1.append("12");
       sb2.append("22");
       sb3.append("32");
       sb4.append("42");
       sb5.append("52");
    rec.add(sb1);
    rec.add(sb2);
    rec.add(sb3);
    rec.add(sb4);
    rec.add(sb5);
 /*  for(int i=0;i<rec.size();i++)
   {
    
     System.out.println(rec.get(i));
   }
 
 
 
******************* StringTokenizer的使用 (分隔字符串)************************************************
   /* String s="1,2,41,5,10;6,7,8"; 
   StringTokenizer st=new StringTokenizer(s,",");
   
   
   
   while(st.hasMoreTokens())
   {
   
    System.out.println(st.nextToken());
    
   } */  
   
    
    
    
//********************Iteraror 和Vector的使用******************************************** 
    
    
 /*  Iterator it=rec.iterator();
   while(it.hasNext())
   {
    System.out.println(it.next());
   } 
   
   
   
**********************Map,HashMap的使用*******************
   Map map=new HashMap();
   map.put("id","123241321");
   System.out.println(map.get("id"));
   
   
   
   
   
**************List和Iterator的使用******************************   
*
   List list=new ArrayList();
   list.add("121212");
   list.add("33333");
   Iterator is=list.listIterator();
   while(is.hasNext())
   {
    System.out.println(is.next());
   }**/
    
    
  /* PersonBean pb=new PersonBean();
*
*
*
*
*****************Iterator和Bean对象的使用 ******** ************  *
*
   PersonVO pvo1=new PersonVO();   
   pvo1.setOid(new Long(1));
   pvo1.setName("wwwww");
   pvo1.setSex(new Long(2));
   pb.add(pvo1);
   
   PersonVO pvo2=new PersonVO();
   pvo2.setOid(new Long(2));
   pvo2.setName("bbbbb");
   pvo2.setSex(new Long(3));
   pb.add(pvo2);
   Iterator iter=pb.getiterator();   
   while(iter.hasNext())
   {
    PersonVO vo=(PersonVO)iter.next();
      System.out.println(vo.getName());
      System.out.println(vo.getOid());
      System.out.println(vo.getSex());
   }
   
   
/********************时    间******************
   Date d=new Date();
   SimpleDateFormat s=new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
      
   System.out.println(s.format(d));
     */
    
    
/*
 * ***************类型转换******************************************
 */    
/*   String s="1234567890";
   
   int i1,i2;
   
   Long l=new Long(s);
   
   
   System.out.println("String is :"+s);
   i1=Integer.parseInt(s);
   
   System.out.println("Integer1 is :"+i1);
   
   System.out.println("Long is :"+l);
      
  */  
 
/*   Test t=new Test();
    System.out.println("double is :          "+t.toDouble("12152441.254124")); 
    System.out.println("float is :           "+t.toDouble("12152441.254124")); 
    System.out.println("int is :             "+t.toInt("145245422"));
    System.out.println("string to Long is :  "+t.toLong("1234567890123456789"));
    System.out.println("float to String is : "+t.toString(1312131.312321f));
    System.out.println("float to int is :    "+t.floatToInt(1255.321414f));
    System.out.println("int to string is :   ");
   }
   
   
   public int toInt(String s)
   {
    int i=0;
    i=Integer.parseInt(s);
    return i;
   }
   
   public Long toLong(String s)
   {
    Long l=new Long(s);    
    return l;
   }
   public float toFloat(String s)
   {
    float f;
    f=Float.parseFloat(s);
    return f;
   }
   public double toDouble(String s)
   {
    double d;
    d=Double.parseDouble(s);
    return d;
   }
   
   
   public String toString(int i)
   {
    String s;
    s=String.valueOf(i);
    return s;    
   }
   public String toString(float f)
   {
    String s;
    s=String.valueOf(f);
    return s;
   }
   public String toString(double d)
   {
    String s;
    s=String.valueOf(d);
    System.out.println("this is DoubleTos");
    return s;
   }
   
   public String toString(Long l)
   {
    String s;
    s=String.valueOf(l);
    System.out.println("this is long");
    return s;
   }
   public int floatToInt(float f)
   {
    int i;
    System.out.println("this is floatToInt");
   i=(int)f; 
    return i;
   }
   */
   /* Test t=new Test();
    //t.arrayOne();
    t.arrayTwo();
    */
/* Svo s=new Sdao();
 s.printS();
   }
   
   public void arrayOne()
   {
    String s[]={"蒋良忠","陈曦","王剑","黄伟"};
    int l=s.length;
    for(int i=0;i<l;i++)
    {
     System.out.println(s[i]);
    }
   }
   public void arrayTwo()
   {
    String s[][]={{"001","蒋良忠"},{"002","陈曦"},{"003","王剑"},{"004","黄伟"}};
    {
     for(int i=0;i<s.length;i++)
     {
      for(int j=0;j<2;j++)
      {
       System.out.print(s[i][j]+"  ");
      }
      System.out.println("");
     }
    }
   }
   */
/*    Test t=new Test();
   // t.pppp();
   try {
    
 } catch (Exception e) {
  // TODO: handle exception
 }*/
/* 
  String str="321456789";
  char c[]=str.toCharArray();
  for(int i=0;i<c.length;i++){
   System.out.println("=="+c[i]+"--------");
  }
   String st="1 2 3 4 5 6 7 8 9";
   String s[]=st.split(" ");
   for(int i=0;i<s.length;i++){
    System.out.println("split----"+s[i]);
   }
   */
    String str="1,2,3,4,5,6,7,8,9";
    StringTokenizer strs=new StringTokenizer(str,",");
    while(strs.hasMoreTokens()){
      System.out.println("sss----------------"+strs.nextToken());
    }
   System.out.println(str.replace(",",";"));
   
    
   }
  /* public void pppp()
   {
   try{       
    int i=0,n=12;
    System.out.println("wwwwww");
    System.out.println(n/i);
    return;
    }catch(Exception e){
     System.out.println("ddddd");
    }
    finally{
     System.out.println("hello java!");
    }
   }*/
   
/*   
   public void testThrow() throws Throwable
   {
    int i=0,n=87;
    n=n/i;
   System.out.println("throw exception!"); 
   }*/
   
}