예제 #1
0
  public static void main(String[] args) {
    // TODO code application logic here
    Person peterParker = new Person();
    Person spiderMan = peterParker;

    spiderMan.hairColor = PINK;

    System.out.println("Hair Color of Peter Parker: " + peterParker.hairColor);
    System.out.println("Hair Color of Spiderman: " + spiderMan.hairColor);
  }
예제 #2
0
  @Override
  public void delete(Person p) {
    int i = 0;
    for (Person tmp : pp) {
      if (p.getId() == tmp.getId()) break;
      i++;
    }
    pp.remove(i);

    // mm.remove(p.id);
  }
예제 #3
0
  @Override
  public void update(Person p) {
    for (Person tmp : pp) {
      if (p.getId() == tmp.getId()) {
        tmp.setId(p.getId());
        tmp.setfName(p.getfName());
        tmp.setlName(p.getlName());
        tmp.setAge(p.getAge());
      }
    }

    // mm.put(p.id, p);
  }
예제 #4
0
 @Override
 public void create(Person p) {
   pp.add(new Person(p.getId(), p.getfName(), p.getlName(), p.getAge()));
 }