ta jest kontynuacją kwestia Why is this exception is not printed? Why it's showing an error?
Tutaj w poniższym kodzie dlaczego ArithmeticException nie jest wyzwalany?Dlaczego wyjątek nie jest tutaj uruchamiany?
class Exp
{
public static void main(String args[])
{
float d,a=1;
try
{
d=0;
a=44/d; //no exception triggered here.. why?
System.out.print("Its not gonna printed a="+a);
}
catch(ArithmeticException e)
{
System.out.println("Print exception"+e);
}
}
}
Zamiast wyjście jest jak następuje:
Its not gonna printed a=Infinity
co się dzieje?