General discussion

  • Creator
  • #2150261

    Java problem


    by rajesh.visu ·

    What is different between throw and throws

All Comments

  • Author
    • #2924036

      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


Viewing 0 reply threads