一道子类继承题,求指点
主类public class Exam5_1{
public static void main(String args[]){
Gradstudent stu1=new Gradstudent();
stu1.setname("mike");
stu1.setage(18);
stu1.status(false);
char stu1.getname();
int stu1.getage();
boolean stu1.status();
}
}
Student类
class Student{
char name;
int age;
public void setname(char name){
name=name;
}
public void setage(int age){
age=age;
}
char getname(){
System.out,println(name);
}
int getage(){
System.out.println(age);
}
}
Gradstudent类
public class Gradstudent extends Student{
boolean marriedstatus;
public void setstatus(boolean marriedstatus){
marriedstatus=marriedstatus;
}
public boolean getstatus(){
System.out.println("His marriedstatus is"+marriedstatus);
}
}
老是显示出错
Exam5_1.java:7: 错误: 需要';'
char stu1.getname();
^
Exam5_1.java:8: 错误: 需要';'
int stu1.getage();
^
Exam5_1.java:9: 错误: 需要';'
boolean stu1.status();
^
3 个错误
为什么???