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

What is nullpointerexception?

775


What do you understand by Header linked List?

835


What is the use of System class?

863


What is use of set in java?

723


Why does java does not support multiple inheritance? Explain

764


Which arithmetic operations can result in the throwing of an arithmeticexception?

832


What is an immutable object? How do you create one in java?

844


Is jdk required on each machine to run a java program?

1033


What is the common usage of serialization? What exceptions occur during serialization?

827


When a byte datatype is used?

1286


Difference between operator overloading and function overloading

844


Why generics are used in java?

793


What is mvc in java?

807


Can a private method of a superclass be declared within a subclass?

761


How does predicate work in java?

783