+ 2
What is the difference between throw & throws?
little confused, help me out!!!
3 Respuestas
+ 4
https://www.sololearn.com/discuss/339575/?ref=app
@Tashi explains it here as well
+ 1
throw statement used for throwing an exception from try to catch block
throws is used to specify that a class used will generate a certain types of exception under certain circumstances.
+ 1
Throw is the action and throws is letting everyone know you can throw any type of exception so they basically come together sometimes. It's recommended learning those kind of things as fast as possible because it can a lot of your time. Errors does takes time to be detected and learning can save it. If you find it too troubling for you, you can try any program to help. I tend to use checkmarx, but it's also important to learn it by yourself.
Anyway, good luck!
Ben.