• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Error in Round-up game

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Trailboss
Posts: 23978
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm moving this to the JavaRanch forum.
 
paul wheaton
Trailboss
Posts: 23978
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic