File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Object Creation of Java Class

leela krishhna

Joined: Aug 24, 2012
Posts: 10

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

Joined: Jan 10, 2002
Posts: 63858

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] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Object Creation of Java Class
It's not a secret anymore!