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 difference between throw and throws in exception
handling.

Answer Posted / aravinda reddy

Whenever we want to force an exception then we use throw
keyword,throw keyword can also be used to pass a custom
message to the exception handling module i.e. the message
which we want to be printed. throw we will use at statement
level.

Whereas when we know that a particular exception may be
thrown or to pass a possible exception then we use throws
keyword. Point to note here is that the Java compiler very
well knows about the exceptions thrown by some methods so
it insists us to handle them. Method Level

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain reverse a linked list recursive java solution?

980


What is the purpose of lambda expressions?

1049


What is the use of flag?

1076


Is string pool garbage collected?

994


What happens when heap memory is full?

983


What are the types of literals?

1173


What is return code?

999


How do you identify independent and dependent variables?

1004


What is the advantage of OOP in java?

1142


How many types of constructors are used in java?

1174


Can we force the garbage collection to run?

943


Is arraylist zero based?

1057


Give me some null interfaces in java?

1050


What are the steps that are followed when two computers connect through tcp?

986


Can we call thread start () twice?

959