Advertisement
Guest User

Untitled

a guest
Mar 28th, 2018
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1.  //will work as expected
  2.         //both Person() and Person(var, var,var) are defined functions of the class Person
  3.         Person testP = new Person("Name", "Nachname", "mail@mail.com");
  4.         testP.setEmail("mail2@mail.com");
  5.         data.add(testP);
  6.        
  7.         //will fail horribly
  8.         Person testP2 = new Person();
  9.             testP2.setEmail("mail2@mail.com");
  10.             testP2.setFirstName("Michael");
  11.             testP2.setLastName("Sloawiks");
  12.         data.add(testP2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement