-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSprinklerSystem.java
More file actions
30 lines (29 loc) · 817 Bytes
/
Copy pathSprinklerSystem.java
File metadata and controls
30 lines (29 loc) · 817 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
class WaterSource{
private String s;
WaterSource(){
System.out.println("WaterSource()");
s = "Constructed";
}
public String toString(){
return s;
}
}
public class SprinklerSystem{
private String value1,value2,value3,value4;
private WaterSource source = new WaterSource();
private int i;
private float f;
public String toString(){
return
"value1 = " + value1 + " " +
"value2 = " + value2 + " " +
"value3 = " + value3 + " " +
"value4 = " + value4 + " " +
"i = " + i + " " + "f = " + f + " " +
"source = " + source;
}
public static void main(String[] args){
SprinklerSystem sprinklers = new SprinklerSystem();
System.out.println(sprinklers);
}
}