So I decided I'd give programming a shot.. I got stuck there.. lol..
The answer to my addition ( number 1 += number 2 ) gives me 22 when I enter 2 and 2.. anyways.. can anyone see what's wrong with this code? lol thanks
code:
//***********************************
//Program Information
//***********************************
//Date Created : 09-09-06
//***********************************
//Goal : Simple Addition
//***********************************
import javax.swing.JOptionPane;
public class Alby2 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String number1 ; // First Number To Add String
String number2 ; // Second Number To Add String
String result ; // Result String
String show ; // To Show Text String
number1 = JOptionPane.showInputDialog ( "Enter Your First Number To Add") ; // Reading Number 1
number2 = JOptionPane.showInputDialog ( "Enter Your Second Number To Add" ) ; // Reading Number 2
result = number1 += number2 ; // Adding Up Both Numbers
show = "The Result Is " + result ; // Text + Answer
JOptionPane.showMessageDialog (null , show ) ; // Show Text
System.exit ( 0 ) ; // End Program
}
}