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).]
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: 18641
posted
0
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
posted
0
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...