what is difference between throw and throws in exception?
Answer Posted / ritesh
Whenever we want to force an exception then we use throw keyword.Moreover throw keyword can also be used to pass a custom message to the exception handling module i.e. the message which we want to be printed.
Whereas when we know that a particular exception may be thrown or to pass a possible exception then we use throws keyword
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is variable explain with example?
Is java a super set of javascript?
when you will synchronize a piece of your code? : Java thread
Is 0 true or false in java?
What is java autoboxing?
difference between byte stream class and character stream class?
Why java is a platform independent? Explain
Differentiate between == and equals().
What is style and indentation?
How do I stop concurrentmodificationexception?
Are arrays static in java?
What are the actions that can occur when a thread enters blocked state?
What is the locale class in java programming?
How dead lock situation occurs in java and how you can identify it?
how its run?