answersLogoWhite

0


Best Answer

The only arithmetic exception I can think of seeing has been caused by a division by zero statement. Trying to do integer division by 0 or mod 0 will result in this arithmetic exception. Note that floating point division by zero will result in "Infinity" being returned, and floating point modulus will result in "NaN" being returned.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What arithmetic operation throws arithmetic exceptions in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can NullPointerException be used with ArithmaticException using throws keyword in java?

No. You cannot throw or catch Null pointer exceptions


When wil you need throws keyword in java?

The throws keyword will be used in method declaration to signify the fact that, some pieces of code inside the method may throw exceptions that are specified in the method signature.


What are the types of exception in java?

Exceptions are of two types: checked exceptions and unchecked exceptions.


What keyword are used in java for exception handling?

The important keywords used in Java with respect to Exception Handling are: a. Throw - The "throw" keyword is used to throw exceptions from inside a method b. Throws - The "throws" keyword is used to signify the fact that the code contents within the current method may be throwing an exception and the calling method must handle them appropriately


What is the purpose of claiming exceptions?

it informs compiler about its possible exceptions. For example,The purpose of Java exception is to tell the Java runtime system what can go wrong


Should a method be capable of throwing more than one kind of exception in Java?

It depends actually... It is not a must. If you have method in which there are chances of two different types of exceptions being created, then your method should have a throws clause that can throw both types of exceptions. If you feel your code wouldn't throw any exception then you need not have a throws declaration in your method at all....


What is operator in java?

An operator is a symbol that does something in Java. for ex: "+" is an arithmetic operator that adds two numbers. ">" is a logical operator that checks if one number is greater than the other. There are many different types of operators in Java like Arithmetic, Logical, Relational and Assignment operators


What happens when you perform arithmetic operations mixing different types of variables in java programming?

Java performs an implicit conversion to a unifying type.


How exception subclass is created in java?

To handle the exceptions in large programs


What is throw exception in java?

The presence of the keywords "throws exception" on a method signature means that, the method may throw an exception whhich it does not handle. It also means that the method that is calling or invoking it has to handle such exceptions. If the calling method does not handle that exception it would have to in turn use the same "throws exception" clause and throw it to its parent method.


What is exception and list some of the common type of exception?

Exceptions are thrown when Java encounters an error. They are a fundamental part of the Java error handling system. In a nutshell, Java will throw an Exception when it encounters an error so that an exception handler can "handle" the error. For instance, if a calculator program is given the command "1/0", Java can throw an ArithmeticException which could be reported back to the user.Some common types are:ArithmeticException - thrown when arithmetic error has occurred, like dividing by 0IOException - thrown when an input or output error has occurred, like a file not foundArrayIndexOutOfBoundsException - thrown when a nonexistent element of an array is requested, like arr[-1]NullPointerException - thrown when some operation if performed on an object whose value is nll.


What is the use of throw statement?

throws keyword/statement is basically used to handle exception in java. throws keyword is used to handle "unchecked exceptions". Example: public void enterdata()throws IOException { BufferedReader inp=new BufferedReader(new InputStreamReader(System.in)); int i=Integer.parseInt(inp.readLine()); } Now after the enterdata function we have used throws keyword because the"readLine" method throws an unchecked exception ie., IOException during user input which cannot be handled by try catch block.