Java Software Solutions, 8e, Global Edition Exercise Solutions, Ch. 4
Chapter 4 Exercise Solutions
EX 4.1. For each of the following pairs, which represents a class and which represents an
object of that class?
a. Weekdays, Friday
b. Java, Language
c. Bird, Eagle
d. Bob, Employee
e. Student, Alice
EX 4.2. List some attributes and operations that might be defined for a class called
WindowPane that represents a window pane.
EX 4.3. List some attributes and operations that might be defined for a class called
Examination that represents a business meeting.
EX 4.4. List some attributes and operations that might be defined for a class called Course
that represents a college course (not a particular offering of a course, just the
course in general).
EX 4.5. Write a method called synonyms that prints at least two synonyms of a word when
invoked. The method should accept no parameters and return no value.
}
EX 4.6. Write a method that accepts two integers and returns the first integer raised to the
power of second integer.