CS508 Modern Programming Languages Assignment 4 Solution Fall 2013

You will write a simple JAVA program that will take input from user, After taking input in try block it will check it if it is your VU id. If it is your VU-ID it will display message “Yes it is my VU-ID” else it will raise an exception MyException, in catch block you will catch the myException

Note you will not write anything in the catch block.

You will write a simple class MyException, this class will extend the exception class and it will display the message, You will write the method public MyException (), to

display the following message.

This is not my VU-ID

My VU-ID is bc123456789  (Note you will display your VU-ID here )

In case if you will write your correct VU-ID