Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Compiled Languages > Java   »   java code

 
Thread Tools Display Modes
Question
 
 
#1  
Old Jun 6, 2007, 03:40 AM
sankulanushkul
New Member
sankulanushkul is offline
 
Join Date: Jun 2007
Posts: 3
sankulanushkul See this member's comment history on his/her Profile page.
java code

please give me a simple java code for addition of two numbers here two numbers are accepted

from users please give me explaination about each code

Reply With Quote
 
     

Answers
 
 
Old Jun 6, 2007, 11:33 AM   #2  
Full Member
jstrike is offline
 
Join Date: May 2007
Location: Wisconsin - Go Packers!
Posts: 391
jstrike See this member's comment history on his/her Profile page.
Quote:
Originally Posted by sankulanushkul
please give me a simple java code for addition of two numbers here two numbers are accepted

from users please give me explaination about each code
Instead of us doing your homework why don't you post some code that you've written and we'll be glad to help you with it.
  Reply With Quote
 
     
 
 
Old Aug 22, 2008, 04:13 PM   #3  
New Member
naimlatifi is offline
 
Join Date: Jan 2008
Posts: 12
naimlatifi See this member's comment history on his/her Profile page.
/ / Addition two numbers
import javax.swing.*;// this package call in JOptionPane
public class Addition
{ public static void main(String args[])
{
String fristNumber;
String secondNumber;
String result;

int number1;
int number2;
// Ask tthe user to input two number

firstNumber=JOptionPane.showInputDialog(''Enter first number'');
secondNumber=JOptionpane.showInputDialog(''Enter second number'');

// Methods below convert from string to int

number1=Integer.parseInt(firsNumber);
number2=Integer.parseInt(secondNumber);
// formule that make addition of two numbers


result=number1+number2;

JOptionPane.showMessageDialog(null, '' the addition of two number is''+result); // Message dialog that will show the addition of two numbers

}
}




I hope that this will help you !


****Naim****
  Reply With Quote
 
     


Thread Tools
Display Modes

 
Similar Sponsors

Similar Threads
Question Asker Forum Answers Last Post
Java code rst9380 Java 1 May 2, 2007 04:56 AM
Java Is used for cleancondenser Utilities 2 Feb 27, 2006 12:28 AM
Java ConradSims2 Internet & the Web 2 Aug 11, 2004 02:47 PM
Java! ConradSims2 Other Computers 2 Mar 14, 2004 04:18 AM
Java Help! dgf8607 Other Computers 1 Jun 24, 2003 01:43 PM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 01:19 PM.