Guest User

Untitled

a guest
Jan 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public User(int id, String name, String lastName) {
  2. if (id > 0)
  3. this.id = id;
  4. else
  5. throw new IllegalArgumentException("id не может быть 0 и меньше");
  6. if (name.isEmpty() || lastName.isEmpty())
  7. throw new RuntimeException("Имя или фамилия не могут быть пустыми");
  8. else {
  9. this.name = name;
  10. this.lastName = lastName;
  11. }
  12. }
Add Comment
Please, Sign In to add comment