what is difference between throw and throws in exception?

Answer Posted / deewan singh

throw keyword is used to throw Exception from any method or static block in Java while throws keyword, used in method declaration, denoted which Exception can possible be thrown by this method.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does %d do in java?

582


Explain java coding standards for classes or java coding conventions for classes?

620


Can Exception handling we can handle multiple catch blocks?

648


Can we force garbage collector to run ?

574


What is the function of compareto in java?

593






How do you reverse a word in java?

533


Explain the different forms of polymorphism?

571


Explain the features of interfaces in java?

558


Can an unreferenced object be referenced again?

767


What about method local inner classes or local inner classes in java?

559


Are private methods final?

488


Why doesn't the java library use a randomized version of quicksort?

550


What is an anonymous class in java?

550


Can an integer be null java?

559


What is a final class ?

606