Savior
Savior
Savior
khoaHoc =
khoaHoc;
public class HocSinh extends Nguoi {
}
private String lop;
this.lop = lop;
super.nhapThongTin(sc);
this.khoaHoc =
System.out.print("nhap lop: ");
khoaHoc;
lop = sc.nextLine();
}
this.hoTen = hoTen;
System.out.print("nhap
ky hoc: "); Scanner(System.in);
} hs.inThongTin();
@Override }
super.inThongTin();
System.out.println(lop);
System.out.println(khoaHoc);
System.out.println(kyHoc);}
");
import java.text.SimpleDateFormat;
hoTen=sc.nextLine();
public class Nguoi {
System.out.print("Nhap ngay
protected String hoTen;
sinh: ");
public Nguoi() {}
System.out.println("nhap que quan: ");
queQuan = sc.nextLine();}
public Nguoi(String hoTen, Date ngaySinh, String public static void main(String[] args)
queQuan) { {
Scanner(System.in);
} catch (ParseException e) {
ng.nhapThongTin(sc);
// TODO Auto-generated catch block
ng.inThongTin();
e.printStackTrace();
}
System.out.println("loi dinh dang");
}
}return ngaySinhDate;
System.out.println(hoTen);
System.out.println(ngaySinh);
System.out.println(queQuan);
Lớp student Scanner sc = new Scanner(System.in);
public SinhVien() { }
this.hoTen = hoTen;
this.msv = msv;
msv = sc.nextLine();
super.nhapThongTin(sc);
super.inThongTin();
System.out.println(msv);
return msv;
dshs;
}
public QLHS() {
public void timKiemHocSinh(int namSinh, String queQuan) {
dshs = new
System.out.println("Danh sach hs sinh nam" + namSinh + "que o "
ArrayList<HocSinh>();
+ queQuan + ":");
}
for (HocSinh hs : dshs) {
dshs.add(hs);
&&(queQuan.equals(hs.queQuan))){
}
hs.inThongTin();}}}
System.out.println("nhap so
System.out.println("Nhap DS hoc sinh cua lop " + lop + ":");
luong hoc sinh: ");
if(lop.equals(hs.getLop())) {
for(int i=0; i<n; i++) {
hs.inThongTin();
HocSinh hs = new HocSinh();
}} }
hs.nhapThongTin(sc);
themHocSinh(hs);}}
public static void main(String[] args) {
QLHS hs = new
QLHS();
Scanner(System.in);
hs.nhapDanhSach(sc);
hs.inDanhSach();
hs.timKiemHocSinh(2004, "hn");
System.out.println("--------------------------
------");
hs.timKiemHocSinh("cnpma");
}
QLNS sc.nextLine();
java.util.Scanner;
Nguoi ns = null;
chon = sc.nextInt();sc.nextLine();
dsns = new
so phan tu.
ns = new HocSinh();
}
break;
case 1:
public void themNhanSu(Nguoi ns) {
ns = new SinhVien(); break;
dsns.add(ns);
default: System.out.println("lua chon ko
} hop le, vui long chon lai");
// collection là tập hợp các phần tử mà bạn muốn lặp QLNS qlns = new QLNS();
BÀI TEST public void addCourse(String TenMH, int Diem) {
public Person() {} }
} }
} package baiThiThu;
public class Student extends Person{ Student st = new Student("Nguyen Thanh Nam", "Trau
Quy - Gia Lam");
private int numCourses;
st.addCourse("Java", 9);
private String[] Courses = new String[10];
st.addCourse("CSDL", 8);
private int[] grades = new int[10];
st.addCourse("Pascal", 10);
public Student(String name, String address) {
st.addCourse("Network", 6);
super(name, address);
System.out.println(st.toString());
}
System.out.println(st.getAverageGrade());
@Override
}
public String toString() {return "Student: " + getName() +
"(" + getAddress() + ")";} }