===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
SCJP 6
daisy lakhanpal wrote:A class variable simply means,one copy shared by all objects.
So all Car objects will have (same) Engine object.
So, Car has an Engine must be true( even if all Car objects have the same Engine object).
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
SCJP 6
All code in my posts, unless a source is explicitly mentioned, is my own.
===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
SCJP 6
In K&B
class A Has-A B if code in class A has a reference to an instance of class B.
Sachin Adat wrote:
In K&B
class A Has-A B if code in class A has a reference to an instance of class B.
It doesn't mention static variable, but still official word needed....... :?:
SCJP 6
SCJP 5.0 - 100%
marc weber wrote:"I would say that static variables do constitute a HAS-A relationship.
Note that HAS-A is typically contrasted with IS-A. That is, composition vs. inheritance. Whether a field is associated with the class or with an instance, it's still composition."
here https://coderanch.com/t/269872/Programmer-Certification-SCJP/HASA#1253435
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
All code in my posts, unless a source is explicitly mentioned, is my own.
Happily living in the valley of the dried frogs with a few tiny ads.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|