Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d656d3c5a8 | |||
| 7e61a24d20 | |||
| 9223c5810c |
6
.classpath
Normal file
6
.classpath
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
|
||||||
|
<classpathentry kind="src" path="src/main/java"/>
|
||||||
|
<classpathentry kind="output" path="build/classes"/>
|
||||||
|
</classpath>
|
||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/build/
|
||||||
23
.project
Normal file
23
.project
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>em-oop</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
9
.settings/org.eclipse.jdt.core.prefs
Normal file
9
.settings/org.eclipse.jdt.core.prefs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=21
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||||
|
org.eclipse.jdt.core.compiler.release=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.source=21
|
||||||
4
.settings/org.eclipse.wst.common.project.facet.core.xml
Normal file
4
.settings/org.eclipse.wst.common.project.facet.core.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<faceted-project>
|
||||||
|
<installed facet="java" version="21"/>
|
||||||
|
</faceted-project>
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
|
|
||||||
public class CUI_20261014 {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// TODO 自動生成されたメソッド・スタブ
|
|
||||||
EmployeeData[] employees = new EmployeeData[5];
|
|
||||||
|
|
||||||
employees[0] = new EmployeeData();
|
|
||||||
employees[0].idEmployee = "10000";
|
|
||||||
employees[0].nmEmployee = "山田龍也";
|
|
||||||
employees[0].knEmployee = "ヤマダタツヤ";
|
|
||||||
employees[0].mailAddress = "yamada@hoge.jp";
|
|
||||||
employees[0].password = "aaa";
|
|
||||||
employees[0].idDepartment = "10";
|
|
||||||
|
|
||||||
employees[1] = new EmployeeData();
|
|
||||||
employees[1].idEmployee = "10001";
|
|
||||||
employees[1].nmEmployee = "高橋準";
|
|
||||||
employees[1].knEmployee = "タカハシジュン";
|
|
||||||
employees[1].mailAddress = "jtaka@hoge.jp";
|
|
||||||
employees[1].password = "bbb";
|
|
||||||
employees[1].idDepartment = "10";
|
|
||||||
|
|
||||||
employees[2] = new EmployeeData();
|
|
||||||
employees[2].idEmployee = "10002";
|
|
||||||
employees[2].nmEmployee = "麻枝史明";
|
|
||||||
employees[2].knEmployee = "マエダフミアキ";
|
|
||||||
employees[2].mailAddress = "fmak@hoge.jp";
|
|
||||||
employees[2].password = "ccc";
|
|
||||||
employees[2].idDepartment = "11";
|
|
||||||
|
|
||||||
employees[3] = new EmployeeData();
|
|
||||||
employees[3].idEmployee = "10003";
|
|
||||||
employees[3].nmEmployee = "丸戸章介";
|
|
||||||
employees[3].knEmployee = "マルトショウスケ";
|
|
||||||
employees[3].mailAddress = "marusyo@hoge.jp";
|
|
||||||
employees[3].password = "ddd";
|
|
||||||
employees[3].idDepartment = "12";
|
|
||||||
|
|
||||||
employees[4] = new EmployeeData();
|
|
||||||
employees[4].idEmployee = "10004";
|
|
||||||
employees[4].nmEmployee = "三宅武";
|
|
||||||
employees[4].knEmployee = "ミヤケタケシ";
|
|
||||||
employees[4].mailAddress = "miya@hoge.jp";
|
|
||||||
employees[4].password = "eee";
|
|
||||||
employees[4].idDepartment = "13";
|
|
||||||
|
|
||||||
for(int i = 0; i < 5; i++) {
|
|
||||||
employees[i].showInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("10002 を検索します");
|
|
||||||
for(int i = 0; i < 5; ) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
|
|
||||||
public class EmployeeData {
|
|
||||||
String idEmployee;
|
|
||||||
String nmEmployee;
|
|
||||||
String knEmployee;
|
|
||||||
String mailAddress;
|
|
||||||
String password;
|
|
||||||
String idDepartment;
|
|
||||||
|
|
||||||
|
|
||||||
public void showInfo() {
|
|
||||||
System.out.println(this.idEmployee + "\t" + this.nmEmployee + "\t" + this.knEmployee + "\t" +
|
|
||||||
this.mailAddress + "\t" + this.password + "\t" + this.idDepartment);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
17
src/main/java/BasicCheck1.java
Normal file
17
src/main/java/BasicCheck1.java
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
public class BasicCheck1 {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO 自動生成されたメソッド・スタブ
|
||||||
|
Book book = new Book();
|
||||||
|
|
||||||
|
book.title = "吾輩は猫である";
|
||||||
|
book.author = "夏目漱石";
|
||||||
|
book.price = 800;
|
||||||
|
|
||||||
|
System.out.println(book.title);
|
||||||
|
System.out.println(book.author);
|
||||||
|
System.out.println(book.price);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
13
src/main/java/BasicCheck2.java
Normal file
13
src/main/java/BasicCheck2.java
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
public class BasicCheck2 {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO 自動生成されたメソッド・スタブ
|
||||||
|
Student student = new Student();
|
||||||
|
student.studentId = 1;
|
||||||
|
student.name = "鈴木一郎";
|
||||||
|
|
||||||
|
student.printProfile();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
35
src/main/java/BasicCheck3.java
Normal file
35
src/main/java/BasicCheck3.java
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
public class BasicCheck3 {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO 自動生成されたメソッド・スタブ
|
||||||
|
Item[] items = new Item[3];
|
||||||
|
|
||||||
|
items[0] = new Item();
|
||||||
|
items[0].name = "ノート";
|
||||||
|
items[0].price = 120;
|
||||||
|
items[0].stock = 50;
|
||||||
|
|
||||||
|
|
||||||
|
items[1] = new Item();
|
||||||
|
items[1].name = "消しゴム";
|
||||||
|
items[1] .price = 80;
|
||||||
|
items[1].stock = 30;
|
||||||
|
|
||||||
|
|
||||||
|
items[2] = new Item();
|
||||||
|
items[2].name = "鉛筆";
|
||||||
|
items[2].price = 60;
|
||||||
|
items[2].stock = 100;
|
||||||
|
|
||||||
|
for (int i = 0; i < items.length; i++) {
|
||||||
|
items[i].sell(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < items.length; i++) {
|
||||||
|
System.out.println(items[i].name + " 価格:" + items[i].price + "円 在庫:" + items[i].stock );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
6
src/main/java/Book.java
Normal file
6
src/main/java/Book.java
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
public class Book {
|
||||||
|
String title;
|
||||||
|
String author;
|
||||||
|
int price;
|
||||||
|
}
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
|
|
||||||
public class CUI_20261014 {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// TODO 自動生成されたメソッド・スタブ
|
|
||||||
EmployeeData[] employees = new EmployeeData[5];
|
|
||||||
|
|
||||||
employees[0] = new EmployeeData();
|
|
||||||
employees[0].idEmployee = "10000";
|
|
||||||
employees[0].nmEmployee = "山田龍也";
|
|
||||||
employees[0].knEmployee = "ヤマダタツヤ";
|
|
||||||
employees[0].mailAddress = "yamada@hoge.jp";
|
|
||||||
employees[0].password = "aaa";
|
|
||||||
employees[0].idDepartment = "10";
|
|
||||||
|
|
||||||
employees[1] = new EmployeeData();
|
|
||||||
employees[1].idEmployee = "10001";
|
|
||||||
employees[1].nmEmployee = "高橋準";
|
|
||||||
employees[1].knEmployee = "タカハシジュン";
|
|
||||||
employees[1].mailAddress = "jtaka@hoge.jp";
|
|
||||||
employees[1].password = "bbb";
|
|
||||||
employees[1].idDepartment = "10";
|
|
||||||
|
|
||||||
employees[2] = new EmployeeData();
|
|
||||||
employees[2].idEmployee = "10002";
|
|
||||||
employees[2].nmEmployee = "麻枝史明";
|
|
||||||
employees[2].knEmployee = "マエダフミアキ";
|
|
||||||
employees[2].mailAddress = "fmak@hoge.jp";
|
|
||||||
employees[2].password = "ccc";
|
|
||||||
employees[2].idDepartment = "11";
|
|
||||||
|
|
||||||
employees[3] = new EmployeeData();
|
|
||||||
employees[3].idEmployee = "10003";
|
|
||||||
employees[3].nmEmployee = "丸戸章介";
|
|
||||||
employees[3].knEmployee = "マルトショウスケ";
|
|
||||||
employees[3].mailAddress = "marusyo@hoge.jp";
|
|
||||||
employees[3].password = "ddd";
|
|
||||||
employees[3].idDepartment = "12";
|
|
||||||
|
|
||||||
employees[4] = new EmployeeData();
|
|
||||||
employees[4].idEmployee = "10004";
|
|
||||||
employees[4].nmEmployee = "三宅武";
|
|
||||||
employees[4].knEmployee = "ミヤケタケシ";
|
|
||||||
employees[4].mailAddress = "miya@hoge.jp";
|
|
||||||
employees[4].password = "eee";
|
|
||||||
employees[4].idDepartment = "13";
|
|
||||||
|
|
||||||
for(int i = 0; i < 5; i++) {
|
|
||||||
employees[i].showInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("10002 を検索します");
|
|
||||||
for(int i = 0; i < 5; ) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
|
|
||||||
public class EmployeeData {
|
public class EmployeeData {
|
||||||
String idEmployee;
|
String idEmployee;
|
||||||
String nmEmployee;
|
String nmEmployee;
|
||||||
String knEmployee;
|
String knEmployee;
|
||||||
String mailAddress;
|
String mailAddress;
|
||||||
String password;
|
String password;
|
||||||
String idDepartment;
|
String idDepartment;
|
||||||
|
|
||||||
|
|
||||||
public void showInfo() {
|
|
||||||
System.out.println(this.idEmployee + "\t" + this.nmEmployee + "\t" + this.knEmployee + "\t" +
|
public void showInfo(){
|
||||||
this.mailAddress + "\t" + this.password + "\t" + this.idDepartment);
|
System.out.println(this.idEmployee + "\t" + this.nmEmployee + "\t" + this.knEmployee + "\t" + "\t" + this.mailAddress + "\t" + this.password + "\t" + this.idDepartment);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
10
src/main/java/Item.java
Normal file
10
src/main/java/Item.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
public class Item {
|
||||||
|
String name;
|
||||||
|
int price;
|
||||||
|
int stock;
|
||||||
|
|
||||||
|
public void sell(int amount) {
|
||||||
|
this.stock = this.stock - amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
54
src/main/java/Main.java
Normal file
54
src/main/java/Main.java
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
public class Main {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO 自動生成されたメソッド・スタブ
|
||||||
|
EmployeeData[] employees = new EmployeeData[5];
|
||||||
|
|
||||||
|
employees[0] = new EmployeeData();
|
||||||
|
employees[0].idEmployee = "10000";
|
||||||
|
employees[0].nmEmployee = "山田龍也";
|
||||||
|
employees[0].knEmployee = "ヤマダタツヤ";
|
||||||
|
employees[0].mailAddress = "yamada@hoge.jp";
|
||||||
|
employees[0].password = "aaa";
|
||||||
|
employees[0].idDepartment = "10";
|
||||||
|
|
||||||
|
employees[1] = new EmployeeData();
|
||||||
|
employees[1].idEmployee = "10001";
|
||||||
|
employees[1].nmEmployee = "高橋準";
|
||||||
|
employees[1].knEmployee = "タカハシジュン";
|
||||||
|
employees[1].mailAddress = "jtaka@hoge.jp";
|
||||||
|
employees[1].password = "bbb";
|
||||||
|
employees[1].idDepartment = "10";
|
||||||
|
|
||||||
|
employees[2] = new EmployeeData();
|
||||||
|
employees[2].idEmployee = "10002";
|
||||||
|
employees[2].nmEmployee = "麻枝史明";
|
||||||
|
employees[2].knEmployee = "マエダフミアキ";
|
||||||
|
employees[2].mailAddress = "fmak@hoge.jp";
|
||||||
|
employees[2].password = "ccc";
|
||||||
|
employees[2].idDepartment = "11";
|
||||||
|
|
||||||
|
employees[3] = new EmployeeData();
|
||||||
|
employees[3].idEmployee = "10003";
|
||||||
|
employees[3].nmEmployee = "丸戸章介";
|
||||||
|
employees[3].knEmployee = "マルトショウスケ";
|
||||||
|
employees[3].mailAddress = "marusyo@hoge.jp";
|
||||||
|
employees[3].password = "ddd";
|
||||||
|
employees[3].idDepartment = "12";
|
||||||
|
|
||||||
|
employees[4] = new EmployeeData();
|
||||||
|
employees[4].idEmployee = "10004";
|
||||||
|
employees[4].nmEmployee = "三宅武";
|
||||||
|
employees[4].knEmployee = "ミヤケタケシ";
|
||||||
|
employees[4].mailAddress = "miya@hoge.jp";
|
||||||
|
employees[4].password = "eee";
|
||||||
|
employees[4].idDepartment = "13";
|
||||||
|
|
||||||
|
for (int i = 0; i < employees.length; i++) {
|
||||||
|
employees[i].showInfo();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
11
src/main/java/Student.java
Normal file
11
src/main/java/Student.java
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
public class Student {
|
||||||
|
|
||||||
|
int studentId;
|
||||||
|
String name;
|
||||||
|
|
||||||
|
|
||||||
|
public void printProfile() {
|
||||||
|
System.out.println("学籍番号:"+this.studentId+" 名前:"+this.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user