aspose file tools*
The moose likes Ranch Office and the fly likes Error in Round-up game Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » This Site » Ranch Office
Bookmark "Error in Round-up game" Watch "Error in Round-up game" New topic
Author

Error in Round-up game

Frank Tamminga
Greenhorn

Joined: Feb 21, 2000
Posts: 14
Hi There,
One of the questions in the round up game is:

You claim it is not possible.
For your information, IT IS, and it can be very usefull. Ever heard about the Singleton pattern?
With this pattern you guarantee only a single instance of a class.
Interrested? Let me know, I will give some source.
[This message has been edited by Frank Tamminga (edited February 21, 2000).]
[This message has been edited by Frank Tamminga (edited February 21, 2000).]
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20639
    ∞

I'm moving this to the JavaRanch forum.


permaculture Wood Burning Stoves 2.0 - 4-DVD set
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20639
    ∞

I am familiar with the Singleton pattern - I implemented a Singleton on Friday.
But! I cannot imagine having a static constructor. Will that even compile?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Frank- Perhaps you could post some code which demonstrates a static constructor. I keep getting "modifier static not allowed here", which seems right since the JLS says constructors cannot be static.

"I'm not back." - Bill Harding, Twister
Frank Tamminga
Greenhorn

Joined: Feb 21, 2000
Posts: 14
I guess I was half asleep when I posted the message. I think you know that funny sensation when your cheecks begin to tinkle and start mimicing a traffic light?
Ofcourse, a constructor cannot be static. It is madness.
I somehow i confused it with private.
A private constructor is legal and can be used to implement a Singleton.
Sorry.
Bigmouth out...
 
 
subject: Error in Round-up game