The Artima Developer Community
Sponsored Link

Java Answers Forum
write a simple java code

1 reply on 1 page. Most recent reply: Nov 12, 2009 12:39 AM by Vincent O'Sullivan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
chean kokkhian

Posts: 1
Nickname: chean
Registered: Nov, 2009

write a simple java code Posted: Nov 11, 2009 6:31 PM
Reply to this message Reply
Advertisement
Write a program that creates a simple calculator . The user enters two numbers in the text fields, Number 1 and Number 2. There are 4 buttons, labeled with “Add”, “Substract”, “Multiply” and “Divide”. When the user clicks any one buttons, the result of the operations to the two integers will be displayed in the Result text field. The program handles two kinds of exceptions.

•NumberFormatException if Number 1 or Number 2 were not an integer
•ArithmeticException if Number2 were zero


Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: write a simple java code Posted: Nov 12, 2009 12:39 AM
Reply to this message Reply
The answer to this problem can be found here:

http://java.sun.com/docs/books/tutorial/getStarted/index.html

Flat View: This topic has 1 reply on 1 page
Topic: Warning: Unchecked call Previous Topic   Next Topic Topic: Java Execution Screen Blank! Please HELP!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use