Question: what is the difference between throw and throws keywords used in java?
Answer: Throws clause is used to declare an exception, which means it works similar to the try-catch block. On the other hand throw keyword is used to throw an exception explicitly. 2. If we see syntax wise than throw is followed by an instance of Exception class and throws is followed by exception class names.