Added Ex2.java