What is the difference between throw and throws?

Answer Posted / ravikiran

throw will declare an exception
throws will throw the exception to the calling method

Is This Answer Correct ?    16 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If you are given the name of the function at run time how will you invoke the function?

689


What is meant by nested loop?

544


What is the use of :: in java?

570


Is object a data type in java?

592


What is a wrapper method?

537






Have you ever used hashtable and dictionary?

579


What is nan in java?

520


What is an infinite loop? How infinite loop is declared?

573


What’s a deadlock?

612


Is string a datatype?

552


what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????

1804


What is methodological framework?

577


What best practices should you follow while writing multithreaded code in java?

545


How many times finalize method will be invoked? Who invokes finalize() method in java?

576


What is float in java?

565