-
Environment Variable Configuration (5 points)
- Set the environment variables and take a screenshot (3 points)
- Run
java -versionand take a screenshot (2 points)
-
Step 1 Folder (14 points)
- The implementation code or a screenshot of the code for the
Accountclass (10 points) - Compile the
.javafile usingjavacand take a screenshot (2 points) - Run the
TestBankingfile and take a screenshot (2 points)
- The implementation code or a screenshot of the code for the
-
Step 2 Folder (12 points)
- The implementation code or a screenshot of the code for the
Customerclass (10 points) - Run the
TestingBankingfile and take a screenshot (2 points)
- The implementation code or a screenshot of the code for the
-
Step 3 Folder (22 points)
- The implementation code or a screenshot of the code for the
depositmethod (10 points) - The implementation code or a screenshot of the code for the
withdrawmethod (10 points) - Run the
TestBankingfile and take a screenshot (2 points)
- The implementation code or a screenshot of the code for the
-
Step 4 Folder (12 points)
- The implementation code or a screenshot of the code for the
Bankclass (10 points) - Run the
TestBankingfile and take a screenshot (2 points)
- The implementation code or a screenshot of the code for the
-
Suppose the
TestBankingclass references theAccountclass and theCustomerclass. After editing the source files of the three classes, only compiling theTestBanking.javasource file also generates the class files of the other classes. Why? Further summarize, when the compiler needs information about a certain class, how does it search for the source file or class file that defines the class? -
Suppose the
Banking.Customerclass and theBanking.Accountclass have been defined, and theCustomerclass references theAccountclass. If you directly runJavac customer.javain the directory where the class is located (under the/bankingsub - directory), an error will occur. Please analyze the reason for the error. -
Describe the function of the
-classpathclasspath. Think about how the JDK compiler and virtual machine locate the required class files. Summarize the order in which the compiler searches for classes and the order in which the JVM searches for classes.
-
Step 5 Folder
- The implementation code or a screenshot of the code for the
Accountclass (10 points) - The implementation code or a screenshot of the code for the
SavingAccountclass (10 points) - The implementation code or a screenshot of the code for the
CheckingAccountclass (10 points) - The modified code or a screenshot of the code for the
TestBankingclass, run theTestBankingfile and take a screenshot (2 points)
- The implementation code or a screenshot of the code for the
-
Step 6 - PR1 Folder
- The implementation code or a screenshot of the code for the
Customerclass (10 points) - Run the
TestBankingfile and take a screenshot (1 point)
- The implementation code or a screenshot of the code for the
-
Step 6 - PR2 Folder
- The implementation code or a screenshot of the code for the
Bankclass (10 points) - The implementation code or a screenshot of the code for the
CustomerReportclass (10 points) - Run the
TestBankingfile and take a screenshot (2 points)
- The implementation code or a screenshot of the code for the
-
Think about how to sort the
Accountcollection defined byArrayListin ascending order of the account balance. Please describe the implementation idea or key statements. -
Summarize the design principle of the singleton pattern. Think about why the attributes and methods are
staticand the constructor isprivate.
-
Step 6 Folder
- The implementation code or a screenshot of the code for the
sortCustomersmethod (10 points) - The implementation code or a screenshot of the code for the
searchCustomersmethod (5 points) - The implementation code or a screenshot of the code for the
compareTomethod (10 points) - The implementation code or a screenshot of the code for the
CustomerReportclass (5 points) - Run the
TestBankingfile and take a screenshot (5 points)
- The implementation code or a screenshot of the code for the
-
Step 7 Folder
- The implementation code or a screenshot of the code for the
OverdraftExceptionclass (15 points) - The implementation code or a screenshot of the code for the
withdrawmethod in theAccountclass (5 points) - The implementation code or a screenshot of the code for the
withdrawmethod in theCheckingAccountclass (5 points) - Run the
TestBankingfile and take a screenshot (5 points)
- The implementation code or a screenshot of the code for the
-
How many class files are generated after compiling this program?
-
Create a class
Bird(bird), give its sound characteristics, and create an instance of theBirdclass in the main class and output its characteristics. -
How to write an abstract class to replace the interface in the program to achieve the same function of the program. Try to compare their differences.
-
Create a Java project, import the
AddressBook.javaandFixedLengthStringIO.javafiles, compile and run it, and take a screenshot of the running result (10 points) -
Step 8
- Create a new
banking.DAOpackage, importFixedLengthStringIO.javainto this package, and create a newCustomerDAO.java. TheCustomerDAOclass encapsulates all methods for accessing theCustomerfile. The implementation code or a screenshot of the code for theCustomerDAOclass. (20 points) - Modify the
Bankclass, call the methods of theCustomerDAOclass to make it support reading customers from the file or saving customers to the file. The implementation code or a screenshot of the code for theBankclass. (20 points) - Create a new
banking.UIpackage, create a newMainWindow.java, call the methods of theBankclass to handle the display of interface components and corresponding button events. The implementation code or a screenshot of the code for theMainWindowclass. (20 points) - Run the
MainWindowfile and take screenshots of the interfaces for adding customers, deleting customers, searching for customers, and sorting customers. (20 points)- Add a customer:
- Delete a customer:
- Search for a customer:
- Sort customers (by last name):
- Create a new
-
环境变量配置(5分)
- 环境变量设置并截图(3分)
java -version并截图(2分)
-
Step 1文件夹(14分)
- Account类实现代码或代码截图(10分)
- 使用
javac编译.java文件并截图(2分) - 运行
TestBanking文件并截图(2分)
-
Step 2文件夹(12分)
- Customer类实现代码或代码截图(10分)
- 运行
TestingBanking文件并截图(2分)
-
Step 3文件夹(22分)
deposit方法实现代码或代码截图(10分)withdraw方法实现代码或代码截图(10分)- 运行
TestBanking文件并截图(2分)
-
Step 4文件夹(12分)
- Bank类实现代码或代码截图(10分)
- 运行
TestBanking文件并截图(2分)
-
假设在
TestBanking类中引用了Account类和Customer类,在编辑了三个类的源文件后,仅编译TestBanking.java源文件同时也生成了其他类的类文件,为什么?进一步归纳,当编译器需要某个类的信息时,如何搜索定义该类的源文件或类文件? -
假设已定义了
Banking.Customer类和Banking.Account类,并且Customer类中引用了Account类,若直接在该类所在目录(/banking子目录下)运行Javac customer.java会出错,请分析出错原因。 -
描述
-classpath类路径的作用,思考JDK的编译器和虚拟机是如何定位到所需的类文件的?归纳编译器搜索类的顺序以及JVM搜索类的顺序。
-
Step 5文件夹
- Account类实现代码或代码截图(10分)
- SavingAccount类实现代码或代码截图(10分)
- CheckingAccount类实现代码或代码截图(10分)
- TestBanking类修改代码或代码截图,运行TestBanking文件并截图(2分)
-
Step 6 - PR1文件夹
- Customer类实现代码或代码截图(10分)
- 运行TestBanking文件并截图(1分)
-
Step 6 - PR2文件夹
- Bank类实现代码或代码截图(10分)
- CustomerReport类实现代码或代码截图(10分)
- 运行TestBanking文件并截图(2分)
-
思考如何对
ArrayList定义的Account集合排序,按照账户的余额由小到大排列?请描述实现思想或关键语句。 -
归纳单例模式的设计原理,思考为什么属性和方法为static?构造函数为private?
-
Step 6文件夹
- sortCustomers方法实现代码或代码截图(10分)
- searchCustomers方法实现代码或代码截图(5分)
- compareTo方法实现代码或代码截图(10分)
- CustomerReport类实现代码或代码截图(5分)
- 运行TestBanking文件并截图(5分)
-
Step 7文件夹
- OverdraftException类实现代码或代码截图(15分)
- Account类的withdraw方法实现代码或代码截图(5分)
- CheckingAccount类的withdraw方法实现代码或代码截图(5分)
- 运行TestBanking文件并截图(5分)
-
该程序编译后生成几个class文件?
-
创建一个类Bird(鸟),给出其声音特征,并在主类中创建一个Bird类的实例,输出其特征。
-
如何编写抽象类代替程序中的接口,实现程序同样的功能。试比较它们的不同。
-
创建一个java工程,导入AddressBook.java 和FixedLengthStringIO.java文件,编译运行,运行结果截图(10分)
-
Step 8
- 新建banking.DAO 包,在该包中导入FixedLengthStringIO.java、新建CustomerDAO.java。CustomerDAO类封装了Customer文件访问的所有方法。CustomerDAO类实现代码或代码截图。(20分)
- 修改Bank类,调用CustomerDAO类的方法,使其支持从文件读取客户或保存客户至文件。Bank类实现代码或代码截图。(20分)
- 新建banking.UI 包,新建MainWindow.java, 调用Bank类的方法,处理界面组件的显示及相应按钮事件。MainWindow类实现代码或代码截图。(20分)
- 运行MainWindow文件,增加客户,删除客户,搜索客户,客户排序的界面截图。(20分)
- 增加客户:
- 删除客户:
- 搜索客户:
- 客户排序(用姓氏排):