Originally posted by Campbell Ritchie:
He hasn't given you enough information yet.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Interviewer just asked me just what i have posted here. He said that he has defined a class. And now he has created the object some how and told me to identify whether it belongs to a singleton class or not.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
I guess you *could* use reflection to get an idea of whether the class an object belongs to implements the Singleton design pattern.
But the better answer would be that wanting to know that is a sign for a design that needs serious improvement.
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Consider Paul's rocket mass heater. |