if i divide a float value from 0 then i get output:- infinity and then throws NumberFormatException why
can anybody favour me.

Recommended Answers

All 3 Replies

now i dont hav NFE
why doesn't 2.0/0.0 throws ArithmeticException

Because that's what the Java definition requires. See the Java Language Specification section 15.17.2...

Division of a nonzero finite value by a zero results in a signed infinity.

NFE is about converting a String to a float, not about arithmetic.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.