Subgoals for Writing a Class 2/4
Differentiate class-level (static) vs. instance/object-level variables
Differentiate class-level (static) vs. instance/object behaviors/methods
Define class variables (static) as needed ‘
public / private / final
Define instance variables (that you want to be interrelated)
Create constructor (behavior) that creates initial state of object
Same name as class
No return type
Default - no parameters
Logic - initialize all variables
Repeat as needed, adding parameters
Consider the SongType class you began in an earlier exercise, as illustrated in the following UML diagram.
Put the code in the right order to complete the default constructor.
Put the code in the right order to complete the specific overloaded constructor.