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 / arun

throw is used to throw an exception manually when we feel
that particular line of code in our program is going to
throw an exception
throw new MyException("exception")

throws is used instead of try and catch block,if we are not
using try and catch block and we know that our program is
going to throw an exception than we use throws key word

public void myExecption() throws Exception

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the program compilation process?

1193


Why java is not 100% object-oriented?

1605


What is bom encoding?

1053


What data type is true or false?

1091


How can you avoid serialization in child class if the base class is implementing the serializable interface?

1132


Which is the class in java?

1119


What’s the difference between callable and runnable?

1185


Is empty string in java?

1257


What do you mean by scope of variable?

943


What is covariant return type?

1158


What is the differences between heap and stack memory in java? Explain

1032


What is a null check?

1071


What is the function of log?

1068


What is difference between filereader and bufferedreader?

1011


what is singleton class in java?

1114