What is the difference between throw and throws?
What is the similarity between try and throw?

Answers were Sorted based on User's Feedback



What is the difference between throw and throws? What is the similarity between try and throw?..

Answer / giri

throw is used to throw an exception manually, where as
throws is used in the case of checked exceptions

Is This Answer Correct ?    4 Yes 1 No

What is the difference between throw and throws? What is the similarity between try and throw?..

Answer / amar

throw is a statement level.throws is a method level.
In manual exception handling,we can also use the throws to
handle the excepions by the jvm,insted of handling there.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Core Java Interview Questions

what is mena by object block any what is the use of that

0 Answers   CGI,


What is compareto () in java?

0 Answers  


Explain break statement and continue statement?

3 Answers  


Explain features of interfaces in java?

0 Answers  


What is private public protected in java?

0 Answers  






What is a memory leak in java?

0 Answers  


how can we synchronize Hash map?

3 Answers   CTS,


Why is method overloading not possible by changing the return type in java?

0 Answers  


How to check if linked list contains loop in java?

0 Answers  


What is the difference between set and list?

5 Answers  


What are the 7 types of characters?

0 Answers  


Which is not Object in Java?

10 Answers   Honeywell,


Categories