what is difference between throw and throws in exception?

Answer Posted / chandra sekhar

In Throws, what ever the exception you are declaring are
handle by JVM. If it is a user defined exception in throws
block, JVM doesn't know when to throw that exception. For
this purpose we use Throw for a certain conditions/logic to
throw these user defined exceptions.

I think the above makes sense.

Is This Answer Correct ?    45 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java literals?

575


What is structure of java heap? What is perm gen space in heap?

538


What is math exp in java?

544


What is procedure overloading?

1798


What are java annotations?

643






What is meant by design patterns?

580


What are latest features introduced with java 8?

586


What do the thread?class methods run() and start() do?

537


What is java dot?

491


What are class members by default?

657


What is difference between arraylist and list in java?

578


Explain about static nested classes in java?

606


What is 32 bit float?

559


What are format specifiers in java?

594


Can a class have an interface?

552