Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is difference between throw and throws in exception?

Answer Posted / balu

throws clause is used when the programmer does not want to handle the exception and throw it out of a method.
throw clause is used when the programmer wants to throw an exception explicitly and wants to handle it using catch block hence throw and throws are contradictory.
throw clause can be used to throw our own exceptions also i.e user-defined exceptions.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between an Interface and an Abstract class?

1225


Implement two stacks using a single array.

1103


Can an interface have a constructor?

1023


Why inputstreamreader is used in java?

1054


What is a generic data type?

1116


What is the difference between JDK and JVM?

1337


In Java list the methods that can be overridden?

1050


Explain about core java?

1190


Explain wait(), notify() and notifyall() methods of object class ?

1112


Can java list be null?

1038


What do you mean by chromounits in java8?

1000


What is the += operator called?

1099


How will you reverse a link list without using recursion?

1082


String class is defined under which package in java?

1141


What are the four pillars of java?

1265