Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in Round-up game

 
Frank Tamminga
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 21736
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm moving this to the JavaRanch forum.
 
paul wheaton
Trailboss
Pie
Posts: 21736
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Frank Tamminga
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic