lolapcsa101
A. Notes
As seen in this StudentArrays repl, if you need to manage height, weight, date of birth, name and address of these 300 students, creating arrays and array lists of double, int and String etc can cause the data out of sync
How will you keep all data fields of one student "bundled"?
There are many similar cases, for instance, all items sold on amazon... a book's title, price, in-stock status..., or a car's make, model, year, color, price... more examples
So we need a way to create a "compound" data type to save different primitive types of values which are associated with a single object such as a student. This is where the concepts of classes and objects come from.
B. Slides
C. HW
Imagine you run a fish store. There are 20 types of pet fish, each with its name, color, weight, life-span, water-type and price. Define a class of Fish, then make up 2 objects of class Fish. You can refer to Student class and objects here.
Name and define two more classes, then create two objects for each class. Here is a list from which you can pick: Car, City, Tree, Table, Bracelet, Bird, Bicycle, Petunias