General discussion

Locked

Java problem

By rajesh.visu ·
What is different between throw and throws

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Basically, Throw

by Tony Hopkinson In reply to Java problem

creates an exception.

Throws is used to tell the caller that these excptions could be thrown and should be handled.

So if Class1 could throw Exception1 and you added throws Exception1 to class1, anything that calls it will get a compiler nudge to handle Exception1s

HtHs

Back to Software Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums