Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7fbb96d

Browse files
committed
more oop code
1 parent d2f8399 commit 7fbb96d

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

fromslides/S15-OOP/RectangleClass/RectangleClassPhase1/Rectangle.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ public class Rectangle
1414
@param len The value to store in length.
1515
*/
1616

17-
public void setLength(double len)
18-
{
17+
public void setLength(double len) {
1918
length = len;
2019
}
2120
}

fromslides/S15-OOP/cat/Cat.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
public class Cat {
22
// all values relate to a cat, in an object
3+
4+
// very rarely do we have public attributes (vars)
5+
// as below
6+
37
public String name;
48
public int age;
59
public boolean isGiantCat;

fromslides/S15-OOP/cat/CatPlus.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
public class Cat {
22
// all values relate to a cat, in an object
3+
4+
// very rarely do we have public attributes (vars)
5+
// as below
36
public String name;
47
public int age;
58
public boolean isGiantCat;

fromslides/S15-OOP/date/Date.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
public class Date {
2+
3+
// very rarely do we have public attributes (vars)
4+
// as below
5+
26
//store all of the values related to a Date into a new object
37
public String dayOfWeek;
48
public int year;

0 commit comments

Comments
 (0)