EO Gaddis Java Chapter 06 6e-ClassesObjectsPart2
EO Gaddis Java Chapter 06 6e-ClassesObjectsPart2
EO Gaddis Java Chapter 06 6e-ClassesObjectsPart2
A Second Look
at Classes and
Objects
Example: OverloadingDemo.java
Address
description: Pliers
units: 25
address
- courseName : String
- Instructor : Instructor
- textBook : TextBook
Instructor TextBook
- lastName : String - title : String
- firstName : String - author : String
- officeNumber : String - publisher : String
if(name != null)
System.out.println("Name is: " +
name.toUpperCase());
Day.THURSDAY
Day.FRIDAY
Day.SATURDAY
Examples:
EnumDemo.java, CarType.java, SportsCar.java, SportsCarDemo.java
Example: SportsCarDemo2.java
item2 Address
item2 Address
Stock
Know stock to purchase Stock class
Know number of shares None
Calculate cost of purchase Stock class
Etc. None or class name