answersLogoWhite

0

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

15y ago

What else can I help you with?

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


How exception subclass is created in java?

To handle the exceptions in large programs


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

Java performs an implicit conversion to a unifying type.


Describe the JAVA throwable class hierarchy and types of exceptions?

In Java there are two main types of Exceptions. * Checked Exceptions - The ones that can be checked & handled in our code. Ex: I/O Exception, SQL Exception etc. In most cases, the compiler itself forces us to catch & handle these exceptions * Un-checked Exceptions - The ones that we cannot & should not handle in our code. Ex. Null Pointer Exception The java.lang.Throwable is the super class of all errors and exceptions in Java. Only objects of this class can be thrown & caught and handled by try-catch blocks. Ex: try { ..... ..... } catch (Exception e){ ... } finally { ... }


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 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.