e đang tập viết mà ké thừa trong java.có 3 lớp người-hs-nhân viên.khi vào lớp gọi các phương thức để chạy thì nó báo lỗi mà k hiêur vì sao.bác nào biết chỉ giúp e với.
package bt;
import java.util.Scanner;
/**
*
* @author truong_vaio
*/
public class nguoi {
String ten;
int tuoi;
String gioitinh;
public nguoi(String ten, int tuoi, String gioitinh) {
this.ten = ten;
this.tuoi = tuoi;
this.gioitinh = gioitinh;
}
public nguoi(){
}
public String getTen() {
return ten;
}
public void setTen(String ten) {
this.ten = ten;
}
public int getTuoi() {
return tuoi;
}
public void setTuoi(int tuoi) {
this.tuoi = tuoi;
}
public String getGioitinh() {
return gioitinh;
}
public void setGioitinh(String gioitinh) {
this.gioitinh = gioitinh;
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package bt;
import java.util.Scanner;
/**
*
* @author truong_vaio
*/
public class hocsinh extends nguoi{
String lop;
public hocsinh(){
}
public static int nhap(){
Scanner y=new Scanner(System.in);
System.out.println("nhap lop");
int lop=y.nextInt();
return lop;
}
public static void in(int lop){
System.out.println("lop;"+ lop);
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package bt;
import java.util.Scanner;
/**
*
* @author truong_vaio
*/
public class nhanvien extends nguoi {
public nhanvien(){
}
public static int nhap(){
Scanner a=new Scanner(System.in);
System.out.println(" nhap luong nhan vien");
int luong=a.nextInt();
return luong;
}
public static void in(int luong){
System.out.println("luong"+ luong);
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package meomeo;
/**
*
* @author truong_vaio
*/
public class Meomeo {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
nguoi.nhap();
nguoi.in(null, tuoi, null);