请帮我修复我的简单程序。我只是Java编程的新手。当我编写程序时,程序已成功编译但无法运行导致按摩错误“线程“main”java.lang.NoSuchMethodError:main中的异常:main”已显示。大家可以帮我运行这个程序吗?
编码是:
人物类...
//Program to display student details using inheritance
class Person {
String name;
int age;
}
学生课...
class Student extends Person
{
int mark1,mark2,mark3;
void putdata()
{
System.out.println("Name = " + name);
System.out.println("Age = " + age);
System.out.println("Mark1 = " + mark1);
System.out.println("Mark2 = " + mark2);
System.out.println("Mark3 = " + mark3);
}
}
标记类...
class Marks
{
public static void main(String[] args)
{
Student obj1=new Student();
obj1.name="Sultanah";
obj1.age=17;
obj1.mark1=67;
obj1.mark2=87;
obj1.mark3=97;
obj1.putdata();
}
}