Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

thow and throws

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
what is a brief and best explanation of difference between throw and throws . please also specify a simple use of throws , it looks unnecessary to use throws
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Did you see the answers in your other post?

The throw keyword is used to throw an exception.
The throws keyword is used to specify that a method might throw an exception.

Study Lesson: Exceptions in Oracle's Java Tutorials.
 
abhay jain
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Jesper de Jong wrote:Did you see the answers in your other post?




yes, i have seen but i was trying to get some more interesting and brief views on this specifically targeted question at throw and throws , but after your opinion......i also think that this one is like repeating the same stuff .. any way, thanks for response
 
Marshal
Posts: 79707
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

abhay jain wrote:

Jesper de Jong wrote:Did you see the answers in your other post?



yes . . .

Read this.
 
Forget Steve. Look at this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    Bookmark Topic Watch Topic
  • New Topic