I trying to display the value of a variable from a method, but I don't know why it will I can't do it. Can anyone help please?...
[Highlight]
//Java extension package
import javax.swing.JOptionPane;
public class Palindrome
{
public static void main(String[] args)
{
int number = 0;
int palindrome = 0;
palindrome = retriveInput(number);
display(palindrome); //Error: Cannot make a static reference to the non-static method display(int) from the type Palindrome
}
public static int retriveInput(int numInput)
{
String userInput = "";
userInput = JOptionPane.showInputDialog("Enter five digit number:");
numInput = Integer.parseInt(userInput);
return numInput;
}
public void display(int test)
{
System.out.print(test);
}
}
[Highlight]