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

difference between byte stream class and character stream class?

4603


How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?

1101


What are the five major types of reference sources?

1196


What is private static class in java?

1062


How do you replace all in word?

1131


How do you create a first line indent?

1047


Why should I use abstract class?

1185


Can a variable be local and static at the same time?

1054


What is a void method java?

1008


How to make a write-only class in java?

1104


How do constructors use this() and super()?

1186


Why we used vector class?

1115


Java is pass by value or pass by reference? Explain

1032


How is final different from finally and finalize?

980


What do you understand by a Static Variable?

1269