This commit is contained in:
xixu-me committed 2024-03-30 16:39:21 +08:00
1 parent 062beda77e
commit b0055a87bd
25 files changed
+40 -93

No files matched your search

-18
View File
@@ -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"
}
]
}
-18
View File
@@ -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"
}
]
}
-18
View File
@@ -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"
}
]
}
+2
View File
@@ -1,3 +1,5 @@
package shopping;
public class Cashier {
private String strName;
private float fMoney;
+2
View File
@@ -1,3 +1,5 @@
package shopping;
public class Customer {
private String strName;
private float fMoney;
+2
View File
@@ -1,3 +1,5 @@
package shopping;
public class Good {
private String strName;
private float fPrice;
+2
View File
@@ -1,3 +1,5 @@
package shopping;
import java.util.ArrayList;
import java.util.List;
+2
View File
@@ -1,3 +1,5 @@
package shopping;
public class Test {
public static void main(String[] args) {
Customer cs = new Customer("zhang", 2000);
-18
View File
@@ -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"
}
]
}
-14
View File
@@ -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;
}
}
-7
View File
@@ -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();