Bookmark Topic Watch Topic
  • New Topic

thow and throws  RSS feed

 
abhay jain
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • 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
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 2
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Report post to moderator
abhay jain wrote:
Jesper de Jong wrote:Did you see the answers in your other post?


yes . . .
Read this.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!