Java Reference
In-Depth Information
4.1
Class Definitions
168
Instance Variables and Methods
171
4
More about Methods
174
Local Variables
180
Blocks
181
Parameters of a Primitive Type
182
Simple Cases with Class Parameters
191
The
Parameter
191
this
Methods That Return a Boolean Value
193
The Methods
and
196
equals
toString
Defining Classes I
Recursive Methods
199
4.2
Information Hiding and Encapsulation
201
and
Modifiers
202
public
private
Example: Yet Another Date Class
203
Accessor and Mutator Methods
204
Preconditions and Postconditions
211
4.3
Overloading
212
Rules for Overloading
213
4.4
Constructors
220
Constructor Definitions
220
Example: The Final Date Class
230
Default Variable Initializations
231
An Alternative Way to Initialize Instance Variables
231
Example: A Pet Record Class
232
The
Class
236
StringTokenizer
Chapter Summary
241
Answers to Self-Test Exercises
242
Programming Projects
247
Search WWH ::




Custom Search