import javax.swing.JOptionPane;
public class Palindrome
{
public static void main(String[] args)
{
int userNumber;
userNumber = retrieveInput();
}
public static int retrieveInput(String userInput, int convertString)
{
try
{
userInput = JOptionPane.showInputDialog("Enter a five digit number");
convertString = Integer.parseInt(userInput);
if (convertString <= 9999 || convertString > 99999) throw new Error();
}
catch (Error e)
{
JOptionPane.showMessageDialog(null,"Number must be five(5) digits.", "Error",JOptionPane.ERROR_MESSAGE);
}
return convertString;
}
}
The error I get is this: The method retrieveInput(String, int) in the type Palindrome is not applicable for the arguments ()
If someone could just let me know in plain English what I'm doing wrong, that would be great.

New Topic/Question
Reply




MultiQuote






|