Java³£ÓôúÂë
/**
* @author he
*
*
* °ÑDateת»»³ÉString£¬ÒÔyyyy-MM-dd HH:mm:ssµÄÐÎʽÏÔʾ
*/
public static String DateToString(Date tempDate) {
String date_str = "";
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // ¹æ¶¨ÈÕÆÚ¸ñʽ
try {
date_str = formatter.format(tempDate);
} catch (Exception ex) {
date_str = "";
}
return date_str;
}
/**
* @authorhe
*
*
* °ÑStringת»»³ÉDate£¬ÐÎʽΪyyyy-MM-dd HH:mm:ss
*/
public static Date StringToDate(String dateStr) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // ¹æ¶¨ÈÕÆÚ¸ñʽ
long long_temp = 0;
Date tempDate;
try {
long_temp = formatter.parse(dateStr).getTime();// ÏÈת»»³ÉlongÐÍ
tempDate = new Date(long_temp); // ÔÚת»»³ÉDateÐÍ
} catch (Exception ex) {
tempDate = null;
}
return tempDate;
}
Ïà¹ØÎĵµ£º
JavaÓïÑÔÖеĸÅÄî¾ÍÊǶ࣬Õâ»ØÓÖÓÐÁ½¸ö¸ÅÄÖØÔغÍÖØд¡£ÕâÊÇÁ½¸öиÅÄҲÊÇÁ½¸öÁî³õѧÕßÈÝÒ×»ìÏýµÄ¸ÅÄî¡£ËûÃǵĸÅÄî½ØÈ»²»Í¬£¬Ö»²»¹ý¶¼Óиö“ÖØ”×Ö£¬¾ÍÒÔΪÊǺÜÏñµÄ¡£ÏÂÃæ½âÊÍÒ»ÏÂÕâÁ½¸ö¸ÅÄ
·½·¨ÖØÔØ(overloading method) ÊÇÔÚÒ»¸öÀàÀïÃ棬·½·¨Ãû×ÖÏàͬ£¬¶ø²ÎÊý²»Í¬¡£·µ»ØÀàÐÍÄØ£¿¿ÉÒÔÏàͬҲ¿ÉÒÔ ......
來Ô´£ºhttp://www.blogjava.net/oxidy/articles/213105.html
1.°üÃüÃû:È«²¿×ÖĸСд:cn.package.bean
2.ÀàÃüÃû:µ¥´ÊµÄÊ××Öĸ´óд:SimpleBean
3.ÊôÐÔÃû³Æ:µÚÒ»¸öµ¥´ÊµÄÊ××ÖĸСд,Ö®ºóÿ¸öµ¥´ÊµÄÊ××Öĸ´óдstudentName
4.·½·¨ÃüÃû:ÓëÊôÐÔÃüÃûÏàͬ:public
void sayHello()
5.³£Á¿ÃüÃû:È«²¿µ¥´Ê´óд:final S ......
1.Ïà¹ØÀàµÄ½éÉÜ
·þÎñÆ÷³ÌÐò²»Í¬ÓÚ¿Í»§»ú¶ËµÄ³ÌÐò£¬ËüÐèÒª³õʼ»¯Ò»¸ö¶Ë¿Ú½øÐмàÌý£¬Óöµ½Á¬½Óºô½Ð£¬²ÅÓëÏàÓ¦µÄ¿Í»§»ú½¨Á¢Á¬½Ó¡£Java.net°üµÄServerSocketÀà°üº¬Á˱àд·þÎñÆ÷ϵͳµÄÈ«²¿ËùÐ蹦ÄÜ£¬¶ø¿Í»§¶ËÈí¼þͨ³£Ê¹ÓÃjava.net°üÖеĺËÐÄÀàSocketÓë·þÎñÆ÷µÄij¸ö¶Ë¿Ú½¨Á¢Á¬½Ó¡£
2.µ¥Ï߳̿ͻ§¶Ë³ÌÐò½¨Á¢²½Ö裺
1£©½¨Á¢socket£ ......
Ìõ¼þ£ºÒÑ°²×°J2SEºÍJ2EE¡£
Microsoft SQL Server 2000 Driver for JDBCÊÇ΢Èí¹«Ë¾Ãâ·ÑÌṩÃâ·ÑÏÂÔصÄÒ»¸öÈí¼þ£¬Çë·ÃÎÊ£º http://www.microsoft.com/sql/default.asp£¬ÏÂÔغóÎļþÃûΪ£ºsetup.exe£¬°²×°ºó£¬Ä¬ÈÏ·¾¶ÊÇ£º%Program Files%\Microsoft SQL Server 2000 Driver for JDBC£¬¸ÃĿ¼ÏÂLIBĿ¼ÀïÓÐ3¸öjarÎļþ¡£ ......
/**
*
* @param par
* ÈëÁ¦Ãû
* @return ÈëÁ¦値
*/
public static String inputfromConsole(String par) {
System.out.println(par);
InputStreamReader ......