Advertisement
Guest User

Untitled

a guest
Dec 6th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public class Person {
  2. private String personName;
  3. private int personAge;
  4. public Person (String name, int age) throws IllegalExceptionArgument {
  5. try {
  6. if (name == null || name.length() == 0 || age < 0 || age > 122) {
  7. throw new IllegalArgumentException();
  8. }
  9. personName = name;
  10. personAge = age;
  11. } catch (IllegalArgumentException e) {
  12. throw e;
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement