what is difference between throw and throws in exception?

Answer Posted / neema

"throw" is used to handle user-defined exception.
JVM handles the exceptions which are specified by "throws"

Is This Answer Correct ?    261 Yes 50 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you pass functions in java?

570


What is the importance of finally block in exception handling?

545


What is the syntax and characteristics of a lambda expression? Explain

547


What are peerless components in java programming?

587


Why do we need strings in java?

530






Can we convert stringbuilder to string in java?

562


Why object class is super class for every class in java?

582


Define max and min heap, also the search time of heap.

599


How many types of java are there?

567


what is a thread pool in java and why is it used?

534


What is module in oop?

571


Difference between ‘is-a’ and ‘has-a’ relationship in java?

543


What do you mean by append?

538


What are the types of exceptions?

598


What is string in java with example?

493