Exercises
Write a program to simulate the conditions under which the following exceptions are thrown :
- NullPointerException,
- NegativeArraySizeException,
- ArrayIndexOutOfBoundsException.
Use the try and cartch statements to recover.
Write a very simple method to validate a password. In case the password is wrong, throw an InvalidPassword exception to signal the errror to the caller.
Try to put any of the programs that you have written until now into a package and execute it.