Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Person {
- private String personName;
- private int personAge;
- public Person (String name, int age) throws IllegalExceptionArgument {
- try {
- if (name == null || name.length() == 0 || age < 0 || age > 122) {
- throw new IllegalArgumentException();
- }
- personName = name;
- personAge = age;
- } catch (IllegalArgumentException e) {
- throw e;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement