What is the difference between throw and throws?

Answer Posted / ranganathkini

The 'throw' statement initiates an exception to be thrown
where as the 'throws' clause declares that the method is
expected to throw 1 or more checked execptions.

Is This Answer Correct ?    43 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you detect memory leaks?

588


Does garbage collection occur in permanent generation space in jvm?

611


Is void a return type?

557


What is the default size of load factor in hashing based collection?

570


How to convert string to char and vice versa?

522






How do you compare objects in java?

505


What are the legal operands of the instanceof operator?

570


What are disadvantages of java?

525


Which java collection does not allow null?

719


What is loop in java?

539


What is static class

622


What is the final keyword?

559


Is 0 true or false in java?

520


What is package protected in java?

530


Explain public static void main(string args[]) in java.

539