what is difference between throw and throws in exception?

Answer Posted / ravivarman

Throw keyword can be used by a program to throw exceptions
explicitly.the execution of the current block stops
immediately after the throw statement.
A method should declare that it can cause an exception and
expects its caller handle or re-throw the exception.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why singleton pattern is better than creating singleton class with static instance?

544


What does file separator do in java?

547


Define an applet in java?

638


What are Normalization Rules? Define Normalization?

558


Explain the difference between an object-oriented programming language and object-based programming language?

554






Can there be an abstract method without an abstract class?

547


What are different types of constants?

534


Explain runtime exceptions?

753


What are the 4 types of research methods?

522


What is canonical name in java?

630


What are features of java?

568


What is fundamental datatype?

537


What is a modifier?

886


How much is a java license?

530


What is hashset in java?

543