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);
  }
Example #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);
  }
Example #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);
  }
Example #4
0
 @Override
 public void create(Person p) {
   pp.add(new Person(p.getId(), p.getfName(), p.getlName(), p.getAge()));
 }