You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lesson_16/objects/objects_app/src/main/java/com/codedifferently/lesson16/wardrobecollection/PersonalCloset.java
+34-21Lines changed: 34 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -36,45 +36,52 @@ public PersonalCloset (String ownerName, int maxCapacity) {
36
36
37
37
//core methods
38
38
39
-
// adds item to closet
39
+
// method adds item to closet
40
40
publicbooleanaddItem(ClothingItemitem) {
41
-
// if closet is full, cannot add item
42
-
if (items.size(0) >= maxCapacity) {
41
+
// if closet is full, cannot add item
42
+
if (items.size(0) >= maxCapacity) {
43
43
returnfalse;
44
44
}
45
45
46
-
//adding item to closet and increasing closet total value of closet
47
-
items.add(item);
48
-
totalValue += item.getValue();
46
+
//adding item to closet and increasing closet total value of closet
47
+
items.add(item);
48
+
totalValue += item.getValue();
49
49
50
-
// checks what season item is meant for and keeps track of number of items in that season
0 commit comments