i'm making a simple program that will accept 7 input using JOptionPane
i'm found out that JOptionPane has been used 7 times i want to transform in function i make it but i encounter an error.
import javax.swing.JOptionPane;
public class SevenWord2A{
public static void main() throws NoSuchMethodError
{
String word1="";
String word2="";
String word3="";
String word4="";
String word5="";
String word6="";
String word7="";
getWord();
String msg = word1 + " " + word2 + " " + word3 + " " + word4 + " " + word5 + " " + word6 + " " + word7;
JOptionPane.showMessageDialog(null, msg);
}
String Function getWord(){
JOptionPane.showInputDialog("Enter Word");
}
}
and this is the error
java.lang.NoSuchMethodError: main
Exception in thread "main"