Why am I getting errors with my Java try…catch?

后端 未结 6 1327
粉色の甜心
粉色の甜心 2021-01-24 05:09

I\'m starting to teach myself more about Java error handling, and this is my first program where I\'m trying to see specific errors instead of using catch (Exception e)

6条回答
  •  南方客
    南方客 (楼主)
    2021-01-24 06:03

    If you look at the manual here delete() only throws a SecurityException.

    Also, it returns a boolean value which indicates whether or not the file was deleted. This should be all the information needed to indicate to the user if everything worked out.

提交回复
热议问题