Day
4
Working with Objects
61
Creating New Objects .............................................................................. 62
Using new ............................................................................................ 63
What new Does ................................................................................... 64
A Note on Memory Management ........................................................ 64
Accessing and Setting Class and Instance Variables ................................... 65
Getting Values ..................................................................................... 65
Changing Values .................................................................................. 65
Class Variables ..................................................................................... 66
Calling Methods ....................................................................................... 67
Class Methods ..................................................................................... 69
References to Objects ............................................................................... 70
Casting and Converting Objects and Primitive Types .............................. 71
Casting Primitive Types ...................................................................... 71
Casting Objects .................................................................................. 72
Converting Primitive Types
to Objects and Vice Versa ................................................................. 73
Odds and Ends ......................................................................................... 73
Comparing Objects ............................................................................. 74
Copying Objects .................................................................................. 75
Determining the Class of an Object ..................................................... 76
The Java Class Libraries ............................................................................ 76
Summary .................................................................................................. 77
Q&A ........................................................................................................ 78
030-4 FM
1/29/96, 8:11 PM
10
xi
Do'stlaringiz bilan baham: |