GeeCON Prague 2014*
The moose likes Java in General and the fly likes Object Creation of Java Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Object Creation of Java Class" Watch "Object Creation of Java Class" New topic
Author

Object Creation of Java Class

leela krishhna
Greenhorn

Joined: Aug 24, 2012
Posts: 10
Requirement:

class A
{
void m1()
{
System.out.println("Hello JAVA");
}
}

For the above class A, we need to create 5 Obects only,
If we try create 6th object it will returns the same reference of previous..
(Means we need to create only 5 Objects)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

What thoughts do you have on how to accomplish this?

Hint: Factory

I assume that this is an assignment or interview question? It'd be a silly thing to do in real code.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Object Creation of Java Class