/Date-exception

creating a date class and throw an exception if it's an invalid one

Primary LanguageJava

Date-exception

Date

throws name_exception:key word indicates that this methos may throw an exception

throw new .....: creating an exception where it must be throw

DException

class extends fromt the super class Exception passing the message to be throw in the constructor

Test

main class where to test the code try: keyword to execute a bloc of code if there is no error catch: to throw an exception in case of error

Screen shot of execution