simply do a casting of result to integer before assigning to result
like


int i = (int) nim1/num2;


regards,
Prateek


On Mar 20, 6:41 pm, avnash <[email protected]> wrote:
> iam a basic learner of java.....i want a solution for the following
> question.......dis is so simple....i dont know wht mistake i hv
> done...please help me solve dis
> problem:
>                                              Write a program that
> creates a user interface to perform integer divisions. The user enters
> two numbers in the textfields, Num1 and Num2. The division of Num1 and
> Num2 is displayed in the Result field when the Divide button is
> clicked. If Num1 or Num2 were not an integer, the program would throw
> a NumberFormatException. If Num2 were Zero, the program would throw an
> ArithmeticException Display the  exception in a message dialog box.
>
>                                  do it quickly!!!!!!!!!!!!!!!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"JAVA-experts" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/JAVA-experts?hl=ab
-~----------~----~----~----~------~----~------~--~---

Reply via email to