First, Date class
Construction method [2]
Date--Long Interchange
Date d = new Date ();
Date D1 = new Date ();
D1.gettime ();
D1.settime ();
Second, DateFormat class
Formatting: Date--String
Parsing: String--Date
SimpleDateFormat class [extends DateFormat]
Public final String format (date date):D ate--String
Time format: yyyy mm month DD Day HH:MM:SS HH:mm:ss YYYY/MM/DD HH:mm:ss
YYYY MM month DD Day YYYY-MM-DD HH:MM:SS
Parsing: String--Date
Public Date Parse (String str);//string--Date
Third, Calendar class
Get any calendar field from the calendar, combine as needed
[GregorianCalendar extends Calendar]
public int get (int field): Parameter is Calendar field year MONTH DATE HOUR MINUTE SECOND
MONTH: The range is 0~11 Second: can be judged at output ((Second>9?second: "0" +second));
Example: Calculate the number of days in February for any year "2"
Add () Subtracts the given calendar, plus the specified time
In the development, the definition class: No parameter constructs must give; when giving the parameter, the full parameter is given.
Object array: The address value of the object is stored-keyboard input data
Iv. User Login and Registration
More in line with object-oriented:
A: Determine the number of classes
B: Determine the functionality of each class
C: Maintaining relationships between classes
Classification of classes:
Basic class entity class---Simple description cn.itcast.pojo cn.itcast: Company domain name anti-write
Action class----action on entity classes
Cn.itcast.dao: operator interface
Cn.itcast.dao.impl: specific Operation implementation class
Test class---There is no such package in real development
Subcontracting of the class:
A: by module: cn.itcast.student
Cn.itcast.student.add
Cn.itcast.student.update
Cn.itcast.student.delete
Cn.itcast.student.find
Cn.itcast.teacher
Cn.itcast.teacher.add
cn.itcast.teacher.update^ ^^ ^^
B: By operation points: Cn.itcast.add
Cn.itcast.add.student
Cn.itcast.add.teacher
Cn.itcast.update
cn.itcast.update.student^ ^^
Note: When writing a method, the parameter is more than three, passing the object
Console class--Password display related
Java Basics-Day 15th