-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssociation.java
216 lines (172 loc) · 5.37 KB
/
Association.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
package association;
import java.util.ArrayList;
/**
@author Habib_Adnan
*/
public class Association {
public static void main(String[] args) {
// TODO code application logic here
Member member=new Member("HABIB", "4", "JOB");
Room room=new Room("100yeards", "Mohakhali");
member.setRoom(room);
System.out.println(member.getRoom().getRoomsize()+" in "+member.getRoom().getRoomlocation()+"\n");
ArrayList<Student>studentdata= new ArrayList<Student>();
Student student= new Student();
student.setName("Habib adnan");
student.setRull("768188");
student.setTreat("computer");
student.setEmail("[email protected]");
Student student1= new Student();
student1.setName("Golam kibria");
student1.setRull("575263");
student1.setTreat("computer");
student1.setEmail("[email protected]");
Student student2= new Student();
student2.setName("Azizul haque");
student2.setRull("575262");
student2.setTreat("architecture");
student2.setEmail("[email protected]");
Student student3= new Student();
student3.setName("Bayzid monshi");
student3.setRull("768205");
student3.setTreat("computer");
student3.setEmail("[email protected]");
School school= new School();
school.setScname("Laimpaha High School");
school.setCode("110336");
/*school.getStudent().add(student);
school.getStudent().add(student1);
school.getStudent().add(student2);
school.getStudent().add(student3);*/
studentdata.add(student);
studentdata.add(student1);
studentdata.add(student2);
studentdata.add(student3);
System.out.println(studentdata.size());
for(int i=0;i<studentdata.size();i++){
System.out.println("Name: "+studentdata.get(i).getName()+" Rull: "+studentdata.get(i).getRull()+" Tread: "+studentdata.get(i).getTreat()+" Email: "+studentdata.get(i).getEmail());
}
/*for(Student std: studentdata){
System.out.println(student.getName()+" "+student.getRull()+" "+student.getTreat()+" "+student.getEmail());
break;
}*/
}
}
class Member{
private String memname;
private String whatsmember;
private String whatsdoingmember;
Room room;
public Member(String memname, String whatsmember, String whatsdoingmember, Room room) {
this.memname = memname;
this.whatsmember = whatsmember;
this.whatsdoingmember = whatsdoingmember;
this.room = room;
}
public Member(String memname, String whatsmember, String whatsdoingmember) {
this.memname = memname;
this.whatsmember = whatsmember;
this.whatsdoingmember = whatsdoingmember;
}
public void setMemname(String memname) {
this.memname = memname;
}
public void setWhatsmember(String whatsmember) {
this.whatsmember = whatsmember;
}
public void setWhatsdoingmember(String whatsdoingmember) {
this.whatsdoingmember = whatsdoingmember;
}
public void setRoom(Room room) {
this.room = room;
}
public String getMemname() {
return memname;
}
public String getWhatsmember() {
return whatsmember;
}
public String getWhatsdoingmember() {
return whatsdoingmember;
}
public Room getRoom() {
return room;
}
public void showalldata(){
System.out.println(memname+" "+whatsmember+" "+whatsdoingmember);
return;
}
}
class Room{
private String roomsize;
private String roomlocation;
public void setRoomsize(String roomsize) {
this.roomsize = roomsize;
}
public void setRoomlocation(String roomlocation) {
this.roomlocation = roomlocation;
}
public String getRoomsize() {
return roomsize;
}
public String getRoomlocation() {
return roomlocation;
}
public Room(String roomsize, String roomlocation) {
this.roomsize = roomsize;
this.roomlocation = roomlocation;
}
}
class Student{
private String name;
private String rull;
private String treat;
private String email;
public void setName(String name) {
this.name = name;
}
public void setRull(String rull) {
this.rull = rull;
}
public void setTreat(String treat) {
this.treat = treat;
}
public void setEmail(String email) {
this.email = email;
}
public String getName() {
return name;
}
public String getRull() {
return rull;
}
public String getTreat() {
return treat;
}
public String getEmail() {
return email;
}
}
class School{
private String scname;
private String code;
ArrayList<Student>studentdata= new ArrayList<Student>();
public void setScname(String scname) {
this.scname = scname;
}
public void setCode(String code) {
this.code = code;
}
public void setStudent(ArrayList<Student> student) {
this.studentdata = student;
}
public String getScname() {
return scname;
}
public String getCode() {
return code;
}
public ArrayList<Student> getStudent() {
return studentdata;
}
}