Win a copy of Rust Web Development this week in the Other Languages forum!

FairGhost

Greenhorn
+ Follow
since Mar 19, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by FairGhost

This is the code n its giving me the following error and even in bok code is correct same i haev have here, if some one can help
Thanx
import javax.swing.JOptionPane;
public class Compersion
{
public static void main (String args[])
{
int num1,num2;
String firstnum, secondnum, result;

firstnum = JOptionPane.showInputDialog("Enter First Number");
secondnum = JOptionPane.showInputDialog("Enter Second Number");

num1 = Integer.parseInt( firstnum);
num2 = Integer.parseInt( secondnum);

result = "";

if (num1 == num2)
result = result + num1 + "==" +num2;

if (num1 != num2)
result = result + num1 + "!=" +num2;

JOptionPane.showMessageDialog(null, result, "Compersion Results");
System.exit( 0);
16 years ago