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

java×Ö·û´®×ª»»³ÉÈÕÆÚ

package com.gaosheng.util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class StringToDate {

/**
* ×Ö·û´®×ª»»³ÉÈÕÆÚ
* @param stringdate Ҫת»»µÄ×Ö·û´®(×Ö·û´®¸ñʽ yyyy-MM-dd)
* @return
*/
public Date getStringtoDate(String stringdate){
Date dd =null;
SimpleDateFormat df =new SimpleDateFormat("yyyy-MM-dd");
Date cDate;
try {
cDate = df.parse(stringdate);
dd=new java.sql.Date(cDate.getTime());
} catch (ParseException e1) {
}
return dd;
}
/**
* ×Ö·û´®×ª»»³ÉÈÕÆÚ
* @param stringdate Ҫת»»µÄ×Ö·û´®
* @param format ×Ö·û´®µÄÈÕÆÚ¸ñʽ
* @return
*/
public Date getStringtoDate(String stringdate,String format){
Date dd =null;
Date cDate;
try {
SimpleDateFormat df =new SimpleDateFormat(format);
cDate = df.parse(stringdate);
dd = new java.sql.Date(cDate.getTime());
} catch (ParseException e1) {
}
return dd;
}
public static void main(String[] args) {
StringToDate d=new StringToDate();
System.out.println(d.getStringtoDate("2009-1-01"));
}
}


Ïà¹ØÎĵµ£º

JavaºËÐÄAPIÐèÒªÕÆÎյij̶È

JavaµÄºËÐÄAPIÊǷdz£ÅÓ´óµÄ,Õâ¸ø¿ª·¢ÕßÀ´Ëµ´øÀ´Á˺ܴóµÄ·½±ã£¬¾­³£ÈËÓÐÆÀÂÛ,javaÈóÌÐòÔ±±äɵ¡£
µ«ÊÇһЩÄÚÈÝÎÒÈÏΪÊDZØÐëÕÆÎյģ¬·ñÔò²»¿ÉÒÔÊìÁ·ÔËÓÃjava£¬Ò²²»»áʹÓþͺÜÄÑ°ìÁË¡£
1¡¢java.lang°üϵÄ80£¥ÒÔÉϵÄÀàµÄ¹¦ÄܵÄÁé»îÔËÓá£
2¡¢java.util°üϵÄ80£¥ÒÔÉϵÄÀàµÄÁé»îÔËÓã¬ÌرðÊǼ¯ºÏÀàÌåϵ¡¢Õý¹æ±í´ïʽ¡¢Ê±¼ä¡¢Ê ......

JavaÖÐÈ¡µ±Ç°µÄ·½·¨Ãû×Ö

stack[0] ±íʾ»ñµÃµ±Ç°·½·¨
1.
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
stack[0].getMethodName();
    StackTraceElement[] stack = Thread.currentThread().getStackTrace();
    stack[
0
].getMethodName(); 
new Exceptio ......

Javaѧϰ EclipseÖÐserialVersionUID

serialVersionUID ÓÃÀ´±íÃ÷ÀàµÄ²»Í¬°æ±¾¼äµÄ¼æÈÝÐÔ¡£
ÓÐÁ½ÖÖÉú³É·½Ê½£º
 Ò»¸öÊÇĬÈϵÄ1L£¬±ÈÈ磺private static final long serialVersionUID = 1L;£¨¶ÔÓ¦ÐÞ¸´·½·¨1£©
 Ò»¸öÊǸù¾ÝÀàÃû¡¢½Ó¿ÚÃû¡¢³ÉÔ±·½·¨¼°ÊôÐÔµÈÀ´Éú³ÉÒ»¸ö64λµÄ¹þÏ£×ֶΣ¬±ÈÈ磺
private static final   long serialVersionUI ......

JavaÔ¶³ÌͨѶÏà¹Ø¼¼Êõ

Ò»¡¢»ùÓÚRMIµÄÒ»´ÎÍêÕûµÄÔ¶³ÌͨÐŹý³ÌµÄÔ­Àí£º
1. ¿Í»§¶Ë·¢ÆðÇëÇó£¬ÇëÇóת½»ÖÁRMI¿Í»§¶ËµÄstubÀࣻ
2. stubÀཫÇëÇóµÄ½Ó¿Ú¡¢·½·¨¡¢²ÎÊýµÈÐÅÏ¢½øÐÐÐòÁл¯£»
3. »ùÓÚsocket½«ÐòÁл¯ºóµÄÁ÷´«ÊäÖÁ·þÎñÆ÷¶Ë£»
4. ·þÎñÆ÷¶Ë½ÓÊÕµ½Á÷ºóת·¢ÖÁÏàÓ¦µÄskeltonÀࣻ
5. skeltonÀཫÇëÇóµÄÐÅÏ¢·´ÐòÁл¯ºóµ÷ÓÃʵ¼ÊµÄ´¦ÀíÀࣻ
6. ´¦Àí ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ