Two Laptop Bag
The moose likes Beginning Java and the fly likes about finalize() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "about finalize()" Watch "about finalize()" New topic

about finalize()

robert chen

Joined: Oct 19, 2003
Posts: 5
How to use about finalize().
class A
class B
1.class B exends class A( B is a A )
2.class A include class B(A has a B)
what is the different about 1,2.
Please tell me.
Elouise Kivineva
Ranch Hand

Joined: Feb 07, 2002
Posts: 154
If class B extends class A it is everything A is but has some other distinguishing features or abilities. As though you had a class MotorVehicle and class extending it such as Truck and Tractor.
If class B contains an A well, it has an A of it's very own. Like you have a class MotorVehicle that has as member data objects SteeringWheel mySteeringWheel and Engine myEngine.
[ December 27, 2003: Message edited by: Elouise Kivineva ]
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

What does this have to do with the "finalize" method?

[Jess in Action][AskingGoodQuestions]
robert chen

Joined: Oct 19, 2003
Posts: 5
Thanks for your help.
I agree. Here's the link:
subject: about finalize()
It's not a secret anymore!