Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b688f210f1 | |||
| 70ceeecf70 |
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,61 +0,0 @@
|
|||||||
|
|
||||||
public class Main {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// TODO 自動生成されたメソッド・スタブ
|
|
||||||
|
|
||||||
EmployeeData[] employee = new EmployeeData[5];
|
|
||||||
|
|
||||||
//インスタンス生成
|
|
||||||
/*EmployeeData em1 = new EmployeeData();
|
|
||||||
EmployeeData em2 = new EmployeeData();
|
|
||||||
EmployeeData em3 = new EmployeeData();
|
|
||||||
EmployeeData em4 = new EmployeeData();
|
|
||||||
EmployeeData em5 = new EmployeeData();*/
|
|
||||||
|
|
||||||
|
|
||||||
//代入
|
|
||||||
employee[0].idEmployee = "10000";
|
|
||||||
employee[0].nmEmployee = "山田龍也";
|
|
||||||
employee[0].knEmployee = "ヤマダタツヤ";
|
|
||||||
employee[0].mailAddress = "yamada@hoge.jp";
|
|
||||||
employee[0].password = "aaa";
|
|
||||||
employee[0].idDepartment = "10";
|
|
||||||
|
|
||||||
employee[1].idEmployee = "10001";
|
|
||||||
employee[1].nmEmployee = "高橋準";
|
|
||||||
employee[1].knEmployee = "タカハシジュン";
|
|
||||||
employee[1].mailAddress = "jtaka@hoge.jp";
|
|
||||||
employee[1].password = "bbb";
|
|
||||||
employee[1].idDepartment = "10";
|
|
||||||
|
|
||||||
employee[2].idEmployee = "10002";
|
|
||||||
employee[2].nmEmployee = "麻枝史明";
|
|
||||||
employee[2].knEmployee = "マエダフミアキ";
|
|
||||||
employee[2].mailAddress = "fmak@hoge.jp";
|
|
||||||
employee[2].password = "ccc";
|
|
||||||
employee[2].idDepartment = "11";
|
|
||||||
|
|
||||||
employee[3].idEmployee = "10003";
|
|
||||||
employee[3].nmEmployee = "丸戸章介";
|
|
||||||
employee[3].knEmployee = "マルトショウスケ";
|
|
||||||
employee[3].mailAddress = "marusyo@hoge.jp";
|
|
||||||
employee[3].password = "ddd";
|
|
||||||
employee[3].idDepartment = "12";
|
|
||||||
|
|
||||||
employee[4].idEmployee = "10004";
|
|
||||||
employee[4].nmEmployee = "三宅武";
|
|
||||||
employee[4].knEmployee = "ミヤケタケシ";
|
|
||||||
employee[4].mailAddress = "miya@hoge.jp";
|
|
||||||
employee[4].password = "eee";
|
|
||||||
employee[4].idDepartment = "13";
|
|
||||||
|
|
||||||
/*メソッド呼び出し
|
|
||||||
for(int i = 0; i < 5; i++) {
|
|
||||||
employee[].showInfo();
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
|
|
||||||
public class ObjectSample {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// TODO 自動生成されたメソッド・スタブ
|
|
||||||
//原本のコピー(インスタンス生成)
|
|
||||||
Student student1 = new Student();
|
|
||||||
Student student2 = new Student();
|
|
||||||
|
|
||||||
//name、ageへの代入
|
|
||||||
student1.name = "田中";
|
|
||||||
student1.age = 30;
|
|
||||||
|
|
||||||
student2.name = "山本";
|
|
||||||
student2.age = 25;
|
|
||||||
|
|
||||||
//introduceメソッドの呼び出し
|
|
||||||
student1.intoroduce();
|
|
||||||
|
|
||||||
student2.intoroduce();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
public class Student {
|
|
||||||
//フィールドの宣言
|
|
||||||
String name;
|
|
||||||
int age;
|
|
||||||
|
|
||||||
//メソッドの定義
|
|
||||||
public void intoroduce() {
|
|
||||||
System.out.println("私の名前は" + this.name);
|
|
||||||
System.out.println("年齢は" + this.age);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
98
src/main/java/EmployeeData.java
Normal file
98
src/main/java/EmployeeData.java
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
public class EmployeeData {
|
||||||
|
|
||||||
|
//フィールドの宣言
|
||||||
|
//社員ID
|
||||||
|
private String idEmployee;
|
||||||
|
//社員名
|
||||||
|
private String nmEmployee;
|
||||||
|
//社員名カナ
|
||||||
|
private String knEmployee;
|
||||||
|
//メールアドレス
|
||||||
|
private String mailAddress;
|
||||||
|
//パスワード
|
||||||
|
private String password;
|
||||||
|
//部署ID
|
||||||
|
private String idDepartment;
|
||||||
|
|
||||||
|
|
||||||
|
//ゲッターとセッター
|
||||||
|
public String getIdEmployee() {
|
||||||
|
return idEmployee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdEmployee(String idEmployee) {
|
||||||
|
this.idEmployee = idEmployee;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getNmEmployee() {
|
||||||
|
return nmEmployee;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setNmEmployee(String nmEmployee) {
|
||||||
|
this.nmEmployee = nmEmployee;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getKnEmployee() {
|
||||||
|
return knEmployee;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setKnEmployee(String knEmployee) {
|
||||||
|
this.knEmployee = knEmployee;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getMailAddress() {
|
||||||
|
return mailAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setMailAddress(String mailAddress) {
|
||||||
|
this.mailAddress = mailAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getIdDepartment() {
|
||||||
|
return idDepartment;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setIdDepartment(String idDepartment) {
|
||||||
|
this.idDepartment = idDepartment;
|
||||||
|
}
|
||||||
|
|
||||||
|
//コンストラクタの作成
|
||||||
|
public EmployeeData(String idEmployee, String nmEmployee, String knEmployee, String mailAddress, String password, String idDepartment) {
|
||||||
|
this.idEmployee = idEmployee;
|
||||||
|
this.nmEmployee = nmEmployee;
|
||||||
|
this.knEmployee = knEmployee;
|
||||||
|
this.mailAddress = mailAddress;
|
||||||
|
this.password = password;
|
||||||
|
this.idDepartment = idDepartment;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//メソッドの作成
|
||||||
|
public void showInfo() {
|
||||||
|
|
||||||
|
System.out.println(getIdEmployee() + getNmEmployee() + getKnEmployee() + getMailAddress() + getPassword() + getIdDepartment());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,17 +1,24 @@
|
|||||||
|
|
||||||
public class EmployeeData {
|
public class EmployeeData {
|
||||||
//フィールド
|
|
||||||
|
//フィールドの宣言
|
||||||
|
|
||||||
|
//社員ID
|
||||||
String idEmployee;
|
String idEmployee;
|
||||||
|
//社員名
|
||||||
String nmEmployee;
|
String nmEmployee;
|
||||||
|
//社員名カナ
|
||||||
String knEmployee;
|
String knEmployee;
|
||||||
|
//メールアドレス
|
||||||
String mailAddress;
|
String mailAddress;
|
||||||
|
//パスワード
|
||||||
String password;
|
String password;
|
||||||
|
//部署ID
|
||||||
String idDepartment;
|
String idDepartment;
|
||||||
|
|
||||||
//メソッド
|
//メソッドの作成
|
||||||
public void showInfo(String employee[]) {
|
public void showInfo() {
|
||||||
System.out.println(this.idEmployee + "\t" + this.nmEmployee + "\t" + this.knEmployee + "\t" + this.mailAddress + "\t" + this.password + "\t" + this.idDepartment);
|
System.out.println(this.idEmployee + "\t" + this.nmEmployee + "\t" + this.knEmployee + "\t" + this.mailAddress + "\t" + this.password + "\t" + this.idDepartment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
41
src/main/java/em_oop_20261014.java
Normal file
41
src/main/java/em_oop_20261014.java
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
public class em_oop_20261014 {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO 自動生成されたメソッド・スタブ
|
||||||
|
|
||||||
|
//複数の社員データをまとめて表示
|
||||||
|
EmployeeData[] employees = new EmployeeData[5];
|
||||||
|
|
||||||
|
//インスタンスの生成
|
||||||
|
EmployeeData employees0 = new EmployeeData("10000", "山田龍也","ヤマダタツヤ", "yamada@hoge.jp","aaa","10");
|
||||||
|
|
||||||
|
//employees[0]
|
||||||
|
employees0.showInfo();
|
||||||
|
|
||||||
|
employees0.setIdEmployee("10000");
|
||||||
|
//ゲッターにて値を参照
|
||||||
|
System.out.println(employees0.getIdEmployee());
|
||||||
|
|
||||||
|
|
||||||
|
//EmployeeData employees1 = new EmployeeData();
|
||||||
|
//employees[1]
|
||||||
|
|
||||||
|
|
||||||
|
//EmployeeData employees2 = new EmployeeData();
|
||||||
|
//employees[2]
|
||||||
|
|
||||||
|
|
||||||
|
//EmployeeData employees3 = new EmployeeData();
|
||||||
|
//employees[3]
|
||||||
|
|
||||||
|
|
||||||
|
//EmployeeData employees4 = new EmployeeData();
|
||||||
|
//employees[4]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
66
src/main/java/em_oop_20261014福森.java
Normal file
66
src/main/java/em_oop_20261014福森.java
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
|
||||||
|
public class em_oop_20261014 {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO 自動生成されたメソッド・スタブ
|
||||||
|
|
||||||
|
//複数の社員データをまとめて表示
|
||||||
|
EmployeeData[] employees = new EmployeeData[5];
|
||||||
|
|
||||||
|
EmployeeData employees0 = new EmployeeData();
|
||||||
|
|
||||||
|
//employees[0]
|
||||||
|
employees0.idEmployee = "10000";
|
||||||
|
employees0.nmEmployee = "山田龍也";
|
||||||
|
employees0.knEmployee = "ヤマダタツヤ";
|
||||||
|
employees0.mailAddress = "yamada@hoge.jp";
|
||||||
|
employees0.password = "aaa";
|
||||||
|
employees0.idDepartment = "10";
|
||||||
|
|
||||||
|
|
||||||
|
EmployeeData employees1 = new EmployeeData();
|
||||||
|
//employees[1]
|
||||||
|
employees1.idEmployee = "10001";
|
||||||
|
employees1.nmEmployee = "高橋準";
|
||||||
|
employees1.knEmployee = "タカハシジュン";
|
||||||
|
employees1.mailAddress = "jtaka@hoge.jp";
|
||||||
|
employees1.password = "bbb";
|
||||||
|
employees1.idDepartment = "10";
|
||||||
|
|
||||||
|
EmployeeData employees2 = new EmployeeData();
|
||||||
|
//employees[2]
|
||||||
|
employees2.idEmployee = "10002";
|
||||||
|
employees2.nmEmployee = "麻枝史明";
|
||||||
|
employees2.knEmployee = "マエダフミアキ";
|
||||||
|
employees2.mailAddress = "fmak@hoge.jp";
|
||||||
|
employees2.password = "ccc";
|
||||||
|
employees2.idDepartment = "11";
|
||||||
|
|
||||||
|
EmployeeData employees3 = new EmployeeData();
|
||||||
|
//employees[3]
|
||||||
|
employees3.idEmployee = "10003";
|
||||||
|
employees3.nmEmployee = "丸戸章介";
|
||||||
|
employees3.knEmployee = "マルトショウスケ";
|
||||||
|
employees3.mailAddress = "marusyo@hoge.jp";
|
||||||
|
employees3.password = "ddd";
|
||||||
|
employees3.idDepartment = "12";
|
||||||
|
|
||||||
|
EmployeeData employees4 = new EmployeeData();
|
||||||
|
//employees[4]
|
||||||
|
employees4.idEmployee = "10004";
|
||||||
|
employees4.nmEmployee = "三宅武";
|
||||||
|
employees4.knEmployee = "ミヤケタケシ";
|
||||||
|
employees4.mailAddress = "miya@hoge.jp";
|
||||||
|
employees4.password = "eee";
|
||||||
|
employees4.idDepartment = "13";
|
||||||
|
|
||||||
|
employees0.showInfo();
|
||||||
|
employees1.showInfo();
|
||||||
|
employees2.showInfo();
|
||||||
|
employees3.showInfo();
|
||||||
|
employees4.showInfo();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user