what is difference between throw and throws in exception?

Answer Posted / chirag

throw will throws the exception,
and throws declares that the function will throw an exception
you should catch all every functions throwing and exception
u declare it or catch it

Is This Answer Correct ?    29 Yes 25 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is Java a dying language?

577


how we can make a read-only class in java?

546


How many bits is a char?

539


Give me an example of array and linked list? Where they can be used?

561


What is the difference between this() and super() in java?

545






You're given a Boolean 2D matrix, can you find the number of islands?

602


What is the purpose of main function in java?

541


What is continuity of a function?

528


Can we write a class without main method in java?

487


What is the equal sign?

567


How do you define a singleton class?

513


What do you mean by ternary operator in java?

562


What is a flag value?

523


Why parsing is done?

509


Can we override tostring method in java?

535