Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  

Setup file



Share on Google+Share on Google+

Setup file
1 Answer(s)      8 years ago
Posted in : Java Beginners
View Answers

July 20, 2009 at 3:43 PM

Hi Friend,

Whenever we want to force an exception then we use throw keyword. The throw keyword is used to force an exception. It can also pass a custom message to your exception handling module. Moreover 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. For instance in the above example we have used -

throw new Exception ("can't be divided by zero");

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. We can also use throws clause on the surrounding method instead of try and catch exception handler. For instance in the above given program we have used the following clause which will pass the error up to the next level -

static int divide(int first,int second) throws Exception{

For more information,please visit the following link:



Related Tutorials/Questions & Answers:
Creating a setup file
Creating a setup file  How to create a setup file in tomcat as done in visual studio... could plz tell me as early as possible
Setup file - Java Beginners
Setup file  Hello sir ,how i can make Java Programs Set up File ,Please give me steps to make that. & What is the difference between Throw and Throws,Can U give me Simple code to Differ Throw and Throws ?  Hi Friend
Setup in Java
Setup in Java  Hello I want to know that how to create make setup in java of a java program or jFrame applicatio or Applet.Plz give answer ASAP. Thanks & Regards Sunil Kumar
Setup validator framework in Struts
Setup validator framework in Struts  How to Setup validator framework in Struts
installation and setup problem - Java Beginners
installation and setup problem  Hi, Iam new to java.Can any one tell me about how to install tomcat5.5 and set up in my windows xp operating system in detail? Thanks in advance
Setup Hibernate Environment
Setup Hibernate Environment - Learn how to setup Hibernate Development... the file It includes the libraries... the downloaded file ( into a directory and then unzip
R Programming Setup
R Programming Setup for Development In this section we are going to setup... you can setup it on your windows 10 computer. For windows its is available... appropriate installer. In case of windows you will exe downloader file in my case
How to setup Apache Spark Development Environment?
Getting started with Spark Framework: How to setup the development... to configure all the necessary software to setup development environment... will need to setup the development environment with Apache Spark. JDK
File  How to create .Exe file in jana
file  how can copy the information in the file to the string?   Store file data into String
file  Could anyone please help me to write a code that does the following: Opens a file named MyName.txt, reads the first line from the file and displays it, and then closes the file. Thank you so much
file  how can add the information to the graphic file
file  Hi,what can delet some of the information of the file
file  Hi,how can delet some of the information of the file
File   How to find all files in our local computer using java
FILE  There is a file named Name.txt that contains information related to appliances.I want to read the contents of this file and I used the code... args[]) { try { File file=new File("Name.txt"); FileReader f=new FileReader(file
file  hi i want read special line of file. what am i doing ? I write... read data from file. please help me! void maketree(BtNode root,int i) throws... at the following link: Read specific line from file
EJB Deployment how to create a simple ejd session bean and how to do project setup
to do project setup...? please help me i am getting difficult
To make java exe or runnable file
To make java exe or runnable file   Helo sir i make a java application.I need to help how run application direct in pc i.e how it packaged, .exe file or setup file
EAR file
EAR file   What is the EAR file
File path for jar file
File path for jar file  Hi Experts, I have created one eclipse... jar file of that application, unfortunately it is giving the error that resource not found for the template file. Also I had tried to get that path from user
Convesion of txt file to doc file.??????
Convesion of txt file to doc file.??????  how to convert text file to doc file using java
String file in to word file in java
String file in to word file in java  How to convert a String format notepad file into Ms word file in java
File manipulations
File manipulations  how to read input to a file from console
File manipulations
File manipulations  how to count number of words in a file