What is the difference between the ‘throw’ and ‘throws’ keyword in java?
Hello Everyone????
What is the difference between the ‘throw’ and ‘throws’ keyword in java?
The ‘throw’ keyword is used to manually throw the exception to the calling method.
And the ‘throws’ keyword is used in the function definition to inform the calling method that this method throws the exception. So if you are calling, then you have to handle the exception.
#Java #throw #throws #OOPS #encapsulation #abstraction #inheritance #Java8 #multithreading #try #catch #exception #interface #functional #object #class #parent #base #super #sub #implement #extends #Java8 #microservices #SpringBoot #frameowork #security #compiler #runtime #interview