General discussion


Java problem

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

This conversation is currently closed to new comments.

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


Related Discussions

Related Forums