Skip to content

Commit 522e6d4

Browse files
committed
'Create and Initialize a new Field' V1
1 parent 496d9dc commit 522e6d4

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/com/company/Main.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,15 @@ class Cars {
108108
List<Car> sedans = new ArrayList<>();
109109
}
110110
}
111+
112+
// 9.
113+
void createAndInitializeNewField() {
114+
class Automobile {
115+
private List<Valve> valves;
116+
117+
public Automobile() {
118+
valves = new ArrayList<Valve>();
119+
}
120+
}
121+
}
111122
}

src/com/company/Valve.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.company;
2+
3+
/**
4+
* Created by lily on 8/3/15.
5+
*/
6+
public class Valve {
7+
}

src/com/company/Wheel.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.company;
2+
3+
/**
4+
* Created by lily on 8/3/15.
5+
*/
6+
public class Wheel {
7+
}

0 commit comments

Comments
 (0)