user.java

来自「webwork2例子」· Java 代码 · 共 83 行

JAVA
83
字号
/*
 * Created on 2005-8-5
 */
package com.skyon.demo.register;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author moxie
 * Email:achqian@yahoo.com.cn
 */
public class User {
    private String name;
    private int age;
    private Date birthday;
    private Address address;
    

    /**
     * @return Returns the address.
     */
    public Address getAddress() {
        return address;
    }
    /**
     * @param address The address to set.
     */
    public void setAddress(Address address) {
        this.address = address;
    }
    /**
     * @return Returns the age.
     */
    public int getAge() {
        return age;
    }
    /**
     * @param age The age to set.
     */
    public void setAge(int age) {
        this.age = age;
    }
    /**
     * @return Returns the birthday.
     */
    public Date getBirthday() {
        return birthday;
    }
    /**
     * @param birthday The birthday to set.
     */
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
    /**
     * @return Returns the name.
     */
    public String getName() {
        return name;
    }
    /**
     * @param name The name to set.
     */
    public void setName(String name) {
        this.name = name;
    }
    public String toString(){
        return " name="+name+" age="+age+" birthday="+birthday+" address="+address;
    }
    public static void main(String[] args){
        Date date = new Date();
        SimpleDateFormat df = new SimpleDateFormat();
        try {
            date = df.parse("05-08-5 下午 5:04");
        } catch (ParseException e) {
            e.printStackTrace();
        }
        System.out.println("date="+df.format(date));
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?