wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 60739
    
  65

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
 
Similar Threads
Constructors are not inherited.
Boone 1.1 Mock # 34
Is there any means to check the number of objects created when a java prgram runs.
How we can find that how much string objects has been created?
garbage collection