i dont know why i cant see the output nor enter input
hello,
when i compile, there is no error. however when i run it, it shows this message
"Exception in thred "main" java.lang.NoSuchMethodError: main
Press any key to continue..." any idea?
my program is related to polymorphism via inheritance.
which separate into 2 files, StaffMember.java & human.java
the Volunteer progrom allows user to enter their details and it will link and display according to the program in StaffMember class.
below are my code:
Code java:
//StaffMember.java
import java.util.*;
import java.text.*;
public class StaffMember
{
protected String name;
protected String address;
protected String phone;
public Staffmember(String eName,String eAddress,String ePhone)
{name=eName;
address=eAddress;
phone=ePhone;}
public String toString()
{
String result="Name :" +name+"\n";
result+="Address:"+address+"\n";
result+="Phone:"+phone;
return result;
}
//human.java
import java.util.*;
import java.text.*;
public class human extends Staffmember
{
public human(String eName,String eAddress, String ePhone)
{
super(eName,eAddress,ePhone);
}
}
the software im using is jcreator, however i not manage to display nor enter details, its only show "Exception in thred "main" java.lang.NoSuchMethodError: main
Press any key to continue..."
Re: i dont know why i cant see the output nor enter input
The problem is pretty much self-explanatory- you don't have a main method. Applications need a main method to run. You can't run something as an application without a main method.
PS- When posting code, make sure you use highlight tags to preserve formatting. I've added them for you this time. You should also use standard naming conventions (variables and methods are lower-case, classes are upper-case), to make it easier for people to help you.
Re: i dont know why i cant see the output nor enter input