Can anyone explain about throw and throws keyword in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can anyone explain about throw and throws keyword in java?

7th Dec 2020, 2:37 PM
Yash Chaudhari
Yash Chaudhari - avatar
2 Answers
7th Dec 2020, 2:46 PM
Manash Saikia [ 45% Active ]
Manash Saikia [ 45% Active ] - avatar
+ 2
throw to throw error throws to indicate that method may throw an error..when you call it, you must use try catch block
7th Dec 2020, 2:50 PM
durian
durian - avatar