refactor
This commit is contained in:
1 parent
062beda77e
commit
b0055a87bd
25 files changed
+40
-93
No files matched your search
-18
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Current File",
|
||||
"request": "launch",
|
||||
"mainClass": "${file}"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Test",
|
||||
"request": "launch",
|
||||
"mainClass": "Test",
|
||||
"projectName": "LibraryManagementSystem"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Current File",
|
||||
"request": "launch",
|
||||
"mainClass": "${file}"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Test",
|
||||
"request": "launch",
|
||||
"mainClass": "Test",
|
||||
"projectName": "SchoolPersonnelManagementSystem"
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Current File",
|
||||
"request": "launch",
|
||||
"mainClass": "${file}"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Test",
|
||||
"request": "launch",
|
||||
"mainClass": "Test",
|
||||
"projectName": "Shopping"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
package shopping;
|
||||
|
||||
public class Cashier {
|
||||
private String strName;
|
||||
private float fMoney;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package shopping;
|
||||
|
||||
public class Customer {
|
||||
private String strName;
|
||||
private float fMoney;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package shopping;
|
||||
|
||||
public class Good {
|
||||
private String strName;
|
||||
private float fPrice;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package shopping;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package shopping;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
Customer cs = new Customer("zhang", 2000);
|
||||
|
||||
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Current File",
|
||||
"request": "launch",
|
||||
"mainClass": "${file}"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Test",
|
||||
"request": "launch",
|
||||
"mainClass": "Test",
|
||||
"projectName": "Temp"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
public class Student {
|
||||
// 单例模式
|
||||
private static Student instance = null;
|
||||
|
||||
private Student() {
|
||||
}
|
||||
|
||||
public static Student getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new Student();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
Student student1 = Student.getInstance();
|
||||
Student student2 = Student.getInstance();
|
||||
System.out.println(student1 == student2);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
package library;
|
||||
|
||||
public class Administrator {
|
||||
private int iId;
|
||||
private String strName;
|
||||
@@ -1,3 +1,5 @@
|
||||
package library;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package library;
|
||||
|
||||
public class Book {
|
||||
private String strIsbn;
|
||||
private String strTitle;
|
||||
@@ -1,3 +1,5 @@
|
||||
package library;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package library;
|
||||
|
||||
public class Student {
|
||||
private int iId;
|
||||
private String strName;
|
||||
@@ -1,3 +1,5 @@
|
||||
package library;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
Administrator adm = new Administrator(1, "John");
|
||||
@@ -1,3 +1,5 @@
|
||||
package school;
|
||||
|
||||
public class Administrator extends Person {
|
||||
private String adminID;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package school;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package school;
|
||||
|
||||
public class Manager extends Person {
|
||||
private static Manager instance = null;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package school;
|
||||
|
||||
public class Person {
|
||||
private String name;
|
||||
private int age;
|
||||
@@ -1,3 +1,5 @@
|
||||
package school;
|
||||
|
||||
public class Staff extends Person {
|
||||
private String staffID;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package school;
|
||||
|
||||
public class Student extends Person {
|
||||
private String studentID;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package school;
|
||||
|
||||
public class Teacher extends Person {
|
||||
private String teacherID;
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
package school;
|
||||
|
||||
import library.Administrator;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
ManagementSys sys = ManagementSys.getInstance();
|
||||
Reference in new issue
Block a user