Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
636 B
3
Indexable
Never
public class TestNameClass {
   public static void main(String args[]) {
      Name n1 = new Name("James", "M.", "Bond");
      Name n2 = new Name("Rebecca", "J.", "Smith");

      System.out.println(n1);
      System.out.println(n2);

      System.out.println(n1.getNormalOrder());
      System.out.println(n2.getReverseOrder());

      n1.setFirstName("Jenny");
      n1.setMiddleInitial("L.");
      n1.setLastName("Lopez");

      System.out.println(n1.getFirstName() + " " + n1.getMiddleInitial() + " " + n1.getLastName());
      System.out.println(n2.getFirstName() + " " + n2.getMiddleInitial() + " " + n2.getLastName());
   }
}
Leave a Comment