incompatible types - found java.lang.String but expected int
843810Jan 25 2008 — edited Jan 25 2008This is an extremely small simple program but i keep getting an "incompatible types - found java.lang.String but expected int" error and dont understand why. Im still pretty new to Java so it might just be something stupid im over looking...
import java.io.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class Lab
{
public static void main(String []args)
{
int input = JOptionPane.showInputDialog("Input Decimal ");
String bin = Integer.toBinaryString(input);
String hex = Integer.toHexString(input);
System.out.println("Decimal= " + input + '\n' + "Binary= " + bin + '\n' + "Hexadecimal " + hex);
}
}