what is difference between throw and throws in exception?

Answer Posted / pavithra

throws is used to throw an exception from the method
without handling that exception where as 'throw' is used
to throw the exception to catch block and handle it.

Is This Answer Correct ?    123 Yes 79 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which language is java?

755


What is __ init __ functions?

795


What is numel matlab?

998


What is the most important feature of java? What is an interface?

759


Explain about transient variables in java?

849


How infinite loop is declared?

751


Give the hierarchy of inputstream and outputstream classes.

817


What are the differences between checked exception and unchecked exception?

747


Is map sorted in java?

814


What is private static class in java?

749


What are the differences between the constructors and methods?

812


How do you compare values in java?

795


How can an exception be thrown manually by a programmer?

728


Are there structures in java?

736


Write a code to show a static variable?

835