Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lab8;
- import java.text.SimpleDateFormat;
- import java.util.Calendar;
- public class Persoana
- {
- private String name;
- private Calendar birthday;
- private String adress;
- private String phone;
- public Persoana(String name, String day, String month, String year, String adress, String phone)
- {
- this.name = name;
- this.adress = adress;
- this.phone = phone;
- this.birthday = Calendar.getInstance();
- this.birthday.set(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day));
- }
- public String getName()
- {
- return name;
- }
- public void setName(String name)
- {
- this.name = name;
- }
- public Calendar getBirthday()
- {
- return birthday;
- }
- public void setBirthday(Calendar birthday)
- {
- this.birthday = birthday;
- }
- public String getAdress()
- {
- return adress;
- }
- public void setAdress(String adress)
- {
- this.adress = adress;
- }
- public String getPhone()
- {
- return phone;
- }
- public void setPhone(String phone)
- {
- this.phone = phone;
- }
- @Override
- public String toString()
- {
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MMM-dd");
- return "<tr>"
- + "<td>" + this.getName() + "</td>"
- + "<td>" + sdf.format(this.getBirthday().getTime()) + "</td>"
- + "<td>" + this.getAdress() + "</td>"
- + "<td>" + this.getPhone() + "</td>"
- + "</tr>";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement