these errors are to be expected, and are actually good. think about it: when you use this code -
you're asking the "sdf" object to take the
string date and try to make sense of it, and then return the date it describes, in the form of a Date object.
but what if the string
date doesn't make sense? if, for example, the user entered some gibberish? well, then, "sdf" will raise an exception, and your code will have to deal with that exception somehow. so, you'll need a try/catch pair for that, and the error you're getting is telling you which exception in particular "sdf" might throw.