Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions 17 - Classes and Objects/src/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Person {
// Instance variables (data or "state")
String name;
int age;
int date_of_birth;

// Classes can contain

Expand All @@ -21,14 +21,17 @@ public static void main(String[] args) {
Person person1 = new Person();
person1.name = "Joe Bloggs";
person1.age = 37;
person1.date_of_birth = 10311984;

// Create a second Person object
Person person2 = new Person();
person2.name = "Sarah Smith";
person2.age = 20;
person2.date_of_birth = 10312002;

System.out.println(person1.name);
System.out.println(person1.date_of_birth);

}

}
}