This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.BufferedReader; | |
| import java.io.FileReader; | |
| import java.io.IOException; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| /** | |
| * AssignmentTwo 类 - 整合所有 part 演示方法,main 方法一键运行所有功能 | |
| * 包含:partOne ~ partSeven 方法,覆盖基础语法、集合、IO、导入功能等演示 | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Visitor类继承自Person类,所以Person类必须先创建好哦 | |
| public class Visitor extends Person { | |
| // 访客特有属性:门票号、游玩日期 | |
| private String ticketNumber; // 门票号(每个访客的门票唯一) | |
| private String visitDate; // 游玩日期(比如"2025-12-01") | |
| // 默认构造方法(无参数) | |
| public Visitor() { | |
| super(); // 调用父类Person的默认构造方法(必须写在第一行) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.BufferedReader; | |
| import java.io.FileReader; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| import java.io.PrintWriter; | |
| import java.time.LocalDateTime; | |
| import java.util.ArrayList; | |
| import java.util.LinkedList; | |
| import java.util.List; | |
| import java.util.Queue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Employee.java(单独文件,需保证文件名与类名一致) | |
| public class Employee { | |
| // 私有成员变量 | |
| private String employeeId; // 员工工号(唯一标识) | |
| private String name; // 员工姓名 | |
| // 1. 无参构造方法(默认构造器,满足实例化需求) | |
| public Employee() { | |
| // 空构造,可根据需要初始化默认值,例如: | |
| // this.employeeId = "DEFAULT_EMP_ID"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.BufferedReader; | |
| import java.io.FileReader; | |
| import java.io.IOException; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| /** | |
| * AssignmentTwo 类 - 整合所有 part 演示方法,main 方法一键运行所有功能 | |
| * 包含:partOne ~ partSeven 方法,覆盖基础语法、集合、IO、导入功能等演示 | |
| */ |