Professional Documents
Culture Documents
Lab Guides: Java SE 8 Programming Language
Lab Guides: Java SE 8 Programming Language
Lab G ui des
Lab Guides Mr Tuan cat
Contents
Unit 3: Classes and Objects............................................................................................................. 3
Lab Guide 1: Class và Object.......................................................................................................3
Objectives:.................................................................................................................................... 3
Problem Descriptions:................................................................................................................... 3
Guidelines:.................................................................................................................................... 3
Lab Guide 2: Xây dựng thông tin quản lý các trường đại học.......................................................5
Constructor:
public Subject (): A default constructor, it should initialize the attribute to null or 0
public Subject (String mainSubject): A constructor với thuộc tính tham số mainSubject để khởi tạo
Subject
Instance methods:
Getter/Setter methods: are used to get/set the value
The Teacher class that extends Teacher:
Instance variables:
o name: tên giáo viên
Constructor:
public Teacher (): A default constructor, it should initialize the attribute to null or 0 )
public Teacher (String name, String collegeName, Subject subject): A constructor with parameters, it
creates the teacher object by setting the three fields to the passed values.
Instance methods:
Getter/Setter methods: are used to get/set the value
public void teach(String content)
Guidelines:
Project struture:
Teacher class:
Subject class:
Results:
Lab Guide 2: Xây dựng thông tin quản lý các trường đại học
Lưu trữ thông tin quản lý các trường đại học
Giáo viên có thể tham gia giảng dạy tại nhiều trường đại học