Added Ex4.java