| Author |
Andrews SCJD book. Is this an error in source code?
|
Yucca Nel
Ranch Hand
Joined: Nov 20, 2008
Posts: 147
|
|
/**
* A structure that keeps track of the locked Dvd records. Note that we
* have not made this static, as doing so would mean that only one set
* of reservations could exist at any given time. We rely on the class
* which uses this ReservationManager to ensure that only one instance
* exists for any reservations.
*/
private static Map<String, DvdDatabase> reservations
= new HashMap<String, DvdDatabase>();
He says that it is not static. Yet it is? Is it meant to be static or not? I would guess static is what we are going for?
|
SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
|
 |
Yucca Nel
Ranch Hand
Joined: Nov 20, 2008
Posts: 147
|
|
|
No one can answer this?
|
 |
Roel De Nijs
Bartender
Joined: Jul 19, 2004
Posts: 4355
|
|
I believe it's meant not to be static, like said in the comment.
in DvdDatabase there is following code:
Here it's static, so just one instance of ReservationsManager and thus also from the reservations-map. so no static is needed in front of the reservations-map.
|
SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
|
 |
 |
|
|
subject: Andrews SCJD book. Is this an error in source code?
|
|
|