This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 63350

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:
subject: Object Creation of Java Class
It's not a secret anymore!