Java СÈÕÀú¸ñʽÊä³ö ÈòÄê¼ÆËã
2010-04-26 22:36
import java.util.Scanner;
public class _calendar {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("ÇëÊäÈëÄê·Ý£º");
Scanner sc = new Scanner(System.in);
int year = sc.nextInt();
if (year < 1900) {
System.out.println("ÇëÊäÈë´óÓÚ1900ÄêµÄÄê·Ý£º");
year = sc.nextInt();
}
System.out.println("ÇëÊäÈëÔ·ݣº");
int month = sc.nextInt();
if (month < 0 || month > 12) {
System.out.println("ÇëÊäÈëÕýÈ·Ô·ݣ¨1-12£©£º");
month = sc.nextInt();
}
System.out.println("Äê·Ý£º" + year + ",Ô·ݣº" + month);
/* ÅжÏÊÇ·ñÊÇÈòÄê */
boolean y = run_count(year);
System.out.println();
/*
* if((year%4==0)&&(year%100!=0)||(year%400==0)) {
* System.out.println("¸ÃÄê·ÝÊÇÈòÄ꣡"); y=true; } else { y=false;
* System.out.println("¸ÃÄê·Ý²»ÊÇÈòÄ꣡"); }
*/
/* ¼ÆËãÊäÈëÔ·ݵÄÌìÊý */
int day;
day = day_count(y, month);
/*
* { if((y==true)&&(month==2)) { day=29;
* System.out.println("¸ÃÄêÔ·ÝÏ£¬Ô·ݣº"+day+"Ìì"); } else
* if((y==false)&&(month==2)) { day=28;
* System.out.println("¸ÃÄêÔ·ÝÏ£¬Ô·ݣº"+day+"Ìì"); } else
* if((month==4)||(month==6)||(month==9)||(month==11)) { day=30;
* System.out.println("¸ÃÄêÔ·ÝÏ£¬Ô·ݣº"+day+"Ìì"); } else {day=31;
* System.out.println("¸ÃÄêÔ·ÝÏ£¬Ô·ݣº"+day+"Ìì");}}
*/
/* ¼ÆËã¸ÃÔµÚÒ»ÌìÊÇÐÇÆÚ¼¸ */
/* 1¡¢¼ÆËãÊäÈëÄê·Ý¾àÀë1900Äê1ÔÂ1ÈÕµÄÌìÊý */
int run = 0;// ÊäÈëÄê·Ý¾à1900Ö®¼äÓжàÉÙÈòÄê
for (int x = 1900; x < year;
Ïà¹ØÎĵµ£º
¹úÍâÖøÃûjava¼¼Êõ×ÊÁÏÍøÕ¾
¹úÍâÖøÃûjava¼¼Êõ×ÊÁÏÍøÕ¾
http://www.onjava.com
O'ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ
http://java.sun.com
¹Ù·½µÄJava¿ª·¢ÕßÍøÕ¾ - ÿÖܶ¼ÓÐÐÂÎÄÕ·¢±í
http://www.developer.com/java
Ó ......
Ñ¡ÔñjavaºóµÄÄÇЩÊÂ…
ÕâÁ½ÌìѧУ¿ªÊ¼ÈÃÎÒÃÇÕâÒ»´óÅú¸ß·ÑÉúÑ¡Ôñ×Ô¼ºµÄרҵ·½Ïò£¬FocuserÎÒ¾¹ýºÃ¼¸¸öÄêÍ·µÄ˼¿¼£¬²¢ÇÒÔÚÎÒÃÇÇ×°®c#ÀÏʦÈÈÇéµÄÏòÎÒÃǽéÉÜ.netµÄÇ°¾°ºó£¬ÒãÈ»¼á¶¨µÄÑ¡ÔñÁËjavaÕâÌõ×Ô¼ºÈÏΪǰ³ÌËƽõµÄµÀ·¡£ÒÔϵÄÕâЩÍøÕ¾ÊÇÎÒƽʱ¾³£·ÃÎʵÄһЩ¹úÍâµÄÓ¢ÎÄjavaÍøÕ¾£¬½ñÌìÌصصķ¢²¼¸ø´ó¼Ò£¬Ï£ÍûÎÒÃÇÄ ......
JavaÎÊÌâ¾µä32ÎÊ
µÚÒ»£¬Ì¸Ì¸final£¬ finally£¬ finalizeµÄÇø±ð¡£
µÚ¶þ£¬Anonymous Inner Class £¨ÄäÃûÄÚ²¿Àࣩ ÊÇ·ñ¿ÉÒÔextends£¨¼Ì³Ð£©ÆäËüÀ࣬ÊÇ·ñ¿ÉÒÔimplements£¨ÊµÏÖ£©interface£¨½Ó¿Ú£©£¿
µÚÈý£¬Static Nested Class ºÍ Inner ClassµÄ²»Í¬£¬ËµµÃÔ½¶àÔ½ºÃ£¨ÃæÊÔÌâÓе ......
ÓõÄÊÇMySQLÊý¾Ý¿â¡£
1£¬½¨Ò»¸öuserdb¿â£¬ÔÙ½¨userinfo±í£¬×ֶΣºid(int),username(varchar),password(varchar)¡£
create database userdb;
use userdb;
create table userinfo(
id int(10) not null auto_increment,
username varchar(20),
password varchar(20),
primary key(id));
2£¬DBConnection.jav ......
µÚһ֪ʶµã£º¹¹ÔìÆ÷£¬¹¹ÔìÆ÷ºÍÀàÃûÒ»Ö£¬ÎÞ·µ»ØÖµ£¬ÔÚjavaÖГ³õʼ»¯”Óë“´´½¨”ÊÇÁ¬ÔÚÒ»ÆðµÄ£¬ËùÒÔÎÒÃǾ³£Óù¹ÔìÆ÷ÔÚ´´½¨¶ÔÏóµÄʱºòÀ´³õʼ»¯ÀàµÄһЩʵÀý¡£ÌØÊâ˵Ã÷£ºnew±í´ïʽ·µ»ØÁ˶Ôн¨¶ÔÏóµÄÒýÓ㬵«Êǹ¹ÔìÆ÷±¾ÉíûÓзµ»ØÈκÎÖµ¡£
µÚ¶þ¸ö֪ʶµã£º·½·¨µÄÖØÔØ£¬Ãû³ÆÏàͬ£¬²ÎÊý²»Í¬µÄ·½·¨½Ð×ö· ......