javaС¼¼ÇÉ£¨Ò»£©
ÔںܶàÊý¾Ý¿âÖУ¬“ÐÔ±ð”ÕâÒ»×Ö¶ÎÊÇÓÃÓÚintÀàÐÍ´æ´¢µÄ£¬ÈçÓÃ0±íʾ“Å®”£¬1±íʾ“ÄД¡£Ê¹ÓÃResultSet¶ÔÏórs½ÓÊÕ²éѯÊý¾Ý£¬ÔÚ»ñÈ¡Êý¾Ýʱʱ£¬rs.getString()·½·¨ºÍrs.getInt()·½·¨»ñÈ¡µÄÈÔÈ»ÊÇ0(Çø±ðÔÚÓÚStringÀàÐÍ»òÊÇintÀàÐÍ)¡£¶øÔÚʵ¼ÊÓ¦ÓÃʱ£¬ÎÒÃǸüÏ£Íû»ñµÃµÄÊý¾ÝÊÇÖ±¹ÛµØÏÔʾ“ÄД»ò“Å®”£¬ÓÐûÓÐʲô°ì·¨ÄØ£¿
ÓÐÈËÁ¢¿ÌÏë³ö£ºÊ¹ÓÃif-elseÓï¾ä¿ØÖÆ£¬»òÕßʹÓÃÈýÔªÔËËã·û¸³Öµ°¡£¡¿ÉÎÊÌâÓÖ³öÏÖÁË£¬ÕâÑù×öµÄ»°ÎÒÃÇÐèÒª¶¨ÒåÒ»¸ö¶îÍâµÄ±äÁ¿£¬¶øÇÒ¼ÙÈçÎÒÃÇÓжà¸öJSPÒ³ÃæÐèÒªÏÔʾÐÔ±ðµÄʱºòÒª¶àдºÜ¶à¶«Î÷¡£ÄѵÀ¶¨Òå³ÉÒ»¸ö·½·¨£¬Ã¿¸öÒ³Ã涼µ÷Ó÷½·¨ÔÙת»»Âð£¿My God£¡
»¹ÊÇ¿´¿´ÏÂÃæµÄ·½·¨°É¡£
ÔÚʵÌåÀàÖж¨Òå˽ÓÐÊôÐÔ²¢·â×°£º
ĬÈÏ·½·¨£º
package test;
public class User {
private int sex;
public int getSex() {
return sex;
}
public void setSex(int sex) {
this.sex= sex;
}
}
»¹ÊǸÄΪÏÂÃæµÄ·½·¨°É£º
package test;
public class User {
private int sex;
public String getSex() {
if(sex==0){
return "Å®";
}else{
return "ÄÐ";
}
}
public void setSex(int sex) {
this.sex = sex;
}
}
´ó¼ÒÓ¦¸Ã¶¼¿´Ã÷°×ÁË£¬Ö»Êǽ«sexµÄgetSex()·½·¨µÄ·µ»ØÀàÐ͸ÄΪStringÀàÐÍ£¬²¢ÇÒÔÚ·½·¨ÖÐ×öÁ˼òµ¥µÄ¸³Öµ£¬ÎÒÃǵÄÄ¿µÄ¾ÍʵÏÖÁË£¡
×ö¸ö¼òµ¥µÄ²âÊÔ°É£º
package test;
public class Test {
public static void main(String[] args) {
User user=new User();
user.setSex(0);
System.out.println(user.getSex());
}
}
Êä³ö½á¹û¾ÍÊÇ“Å®”À²£¬Èç¹ûsetSex(1)µÄ»°£¬Êä³ö×ÔÈ»ÊÇ“ÄД¿©£¡
µ±È»£¬ÎªÁ˳ÌÐòµÄÑÏÃÜÐÔ£¬»¹ÊÇÓ¦¸Ã½«·½·¨Ð´µÄ¸üϸÖÂһЩ£º
package test;
public class User {
private int sex;
public String getSex() {
if(sex==0){
return "Å®";
}else if(sex==1){
ret
Ïà¹ØÎĵµ£º
Java Tools
Java ToolsÊÇÒ»¸öÇáÁ¿¼¶IDE£¬ÓÃÓÚ´´½¨¡¢±àÒë¡¢Ö´ÐС¢µ÷ÊÔJavaÓ¦ÓóÌÐòÓëapplets¡£Ëü»¹ÄÚÖÃÒ»¸öÎı¾±à¼Æ÷ºÍÒ»¸öÓµÓÐÓû§²Ù
×÷½çÃæµÄJavaµ÷ÊÔÆ÷¡£ËüÒ×ÓÚʹÓÃÌرðÊʺÏÓÚJava³õѧÕß¡£
Eclipse
Eclipseƽ̨ÊÇIBMÏò¿ª·¢ ......
ÏÖÔÚ»¹ÓкܶàÈ˸㲻¶®PHPºÍJAVA¿ª·¢µÄÐͬOAµ½µ×ÓÐʲô²»Í¬£¬¶Ô×Ô¼ºµ½µ×ÓÐʲôӰÏ죬ÒÔÖÁÓÚ×ö³öÁË´íÎóµÄÑ¡Ôñ¶øêݺ¦ÎÞÇî¡£±ÊÕ߸ù¾ÝÁ½ÖÖ¼¼ÊõµÄÌصãÖØÐÂÕûÀíÁËÒ»¸ö¶Ô±È£¬¸ø¹ØÐÄÐͬOA¼¼ÊõµÄ¶ÁÕß×ö¸ö²Î¿¼¡£
»ªÌ춯Á¦ÐͬOAÊDzÉÓÃJAVA¼¼ÊõµÄµäÐÍ´ú±í£¬²¢¾ßÓÐһϵÁÐÓÅ»¯É ......
JSPÔ´´úÂë
<%
//»ñȡϵͳʱ¼ä
//String ddate=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
TimeZone tz = TimeZone.getTimeZone("ETC/GMT-8");
TimeZone.setDefault(tz);
  ......
ת£º http://hi.baidu.com/jiong0818/blog/item/93f9b21641294b4d20a4e971.html JavaÖÐÈÕÆÚ¸ñʽת»» /** * ×Ö·û´®×ª»»Îªjava.util.Date
* Ö§³Ö¸ñʽΪ yyyy.MM.dd G 'at' hh:mm:ss z Èç '2002-1-1 AD at 22:10:59 PSD'
* yy/MM/dd HH:mm:ss Èç '2002/1/1 17:55:00'
* yy/MM/dd HH:mm:ss pm Èç '2002/1/1 17:55:00 p ......