This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Factory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Factory" Watch "Factory" New topic
Author

Factory

William Pearson
Greenhorn

Joined: Dec 28, 2006
Posts: 5


Each Roo should have a Moo and a Loo. Each Moo and Loo have names but how would I refer to to names of the parts of the Roo in the ROO_LIST?
Matt Cartwright
Ranch Hand

Joined: Aug 25, 2008
Posts: 149

alrighty, let's assume

Roo {

actually means

class Roo {

what does getInstance() return? An instance of Roo?

Where does the string returned by getStrin() on the instance
returned by getInstance() get set?

And what type is Object? A singleton?
I have been using getInstance() on singletons only.

Matt
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18488
    
  40


Agreed. This question seems to be about pseudo code than Java -- and even then, the question seems to be unclear.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
William Pearson
Greenhorn

Joined: Dec 28, 2006
Posts: 5
Yes, getInstance() returns the Singleton.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

No offence but I think that you should try to use less patterns and first learn java. And give us some more information because we're guessing. What is Object? Is it the java.lang.Object class? Then it's no wonder that it's not compiling because that class does not contain the static function getInstance.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
William Pearson
Greenhorn

Joined: Dec 28, 2006
Posts: 5
It is not java.lang.Object.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

William,
It is always a good idea to PostRealCode


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Matt Cartwright
Ranch Hand

Joined: Aug 25, 2008
Posts: 149

William Pearson wrote:It is not java.lang.Object.


If you ask others to answer your questions,
you should be s polite to answer theirs.

There was no doubt about that Object not being java.lang.Object.

So, what type is it?

And could you provide some code that actually
stands a chance to compile? Please.

Would help us to help you.

Matt
William Pearson
Greenhorn

Joined: Dec 28, 2006
Posts: 5
I have found the answer to my question. I appreciate the help. Thanks.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Just another cross poster
http://forums.sun.com/thread.jspa?threadID=5431879&tstart=0

Please read http://faq.javaranch.com/java/BeForthrightWhenCrossPostingToOtherSites
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Factory
 
Similar Threads
Adding strings together
String array
Help please !!
splitting a string
class As A Data Type