answersLogoWhite

0

Write the 3 user defined exception in java?

Updated: 8/18/2019
User Avatar

Wiki User

14y ago

Best Answer

1. Arithmetic Exception

2. Input Output Exception

3. Number Format Exception

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write the 3 user defined exception in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can userdefined exception have two methods in it?

Yes a user defined exception can have any number of methods in it. A user defined exception is nothing but a Java class created for a specific purpose. Just like ordinary Java classes, you can have any number of methods in it...


Can a class extend exception?

Yes You can. The features of such a class would be similar to what an Exception would have but not exactly as a predefined Java Exception. When you create a user defined exception you extend the java.lang.Exception class which in turn extends the java.lang.Throwable so indirectly you are extending the Throwable class while creating a user defined exception...


What is user exceptions?

user defined exception is created by user such as arthmetic,number format exception ...


Why would you want to use user defined exception handling?

sometimes there are situations where the program is vary long which can make error debugging a long process so java provides a facility to make user defined exception handling suppose we are dividing two numbers a/b and if the user enters the value of b 0, the user wants to display an error of your own so the user can do this by using exception handling


What are user defined keywords in java?

As far as I know, keywords are part of the implementation of Java, and cannot be defined or redefined.


What is user define package?

A user defined package is a package outside of the standard Java libraries.


Is main a predefined function in java?

No. It is a user defined function which the person who is creating the java class has to code by himself.


Is string is primitive or user defined data type?

String - is primitive data typestring - is user defined data type


What are common types of user defined exceptions?

There are no common types of user-defined exceptions. If they were common, they'd already be provided as standard. The whole point of a user-defined exception is to differentiate between the common and the uncommon. For common exceptions such as range errors we can simply throw a std::range_error; we don't need a user-defined exception unless we need to throw additional information that cannot easily be provided by the standard library exception.


What is the main feature of the programming language Java Classpath?

Java Classpath is a parameter that tells the Java Virtual Machine or the Java Compiler, where to search for user-defined classes and packages on a computer.


When should we use exception handling in java?

Exception handling should be used in Java in all cases where you as a programmer suspect that your code might throw some exceptions or create errors that might look ugly when a user is using the application. In such cases you use exception handling to catch and handle the exception and exit gracefully. You use the try - catch block in Java for exception handling.


What are the different types of package in java?

1.user defined packages 2.predefined packages