- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoop_array.java
More file actions
Latest commit
53 lines (37 loc) · 783 Bytes
/
Copy pathoop_array.java
File metadata and controls
53 lines (37 loc) · 783 Bytes
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
classMain {
publicstaticvoidmain(Stringargs[])
{
bot[] army = newbot[2];
army[0] = newbot();
army[1] = newbot();
army[0].setData(4123, "helmut");
army[1].setData(4322, "uwe");
for(botvalue: army)
{
System.out.println(value);
}
intcount = 0;
while (count < army.length)
{
army[count].getData();
count++;
}
System.out.println();
army[0].getData();
army[1].getData();
}
}
classbot
{
publicintid;
publicStringname;
publicvoidsetData(intid, Stringname)
{
this.id = id;
this.name = name;
}
publicvoidgetData()
{
System.out.println("ID: " + id + "\tname: " + name);
}
}