File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes using an object in other class... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

using an object in other class...

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
In classA, hash map ,say I have 3 records like empNo,Employee

Now I need to get these 3 values in class B...

I wrote :---

HashA hmapA=new HashA<String,Emloyee> (having getters and setters)


In CLassB:-->

If I do ClassA classA =new ClassA();

// This would mean a new object isn't it?

I have HashB hMapB=new HAshB<String,Employee>

I wrote...


I am getting null in the above!
Embla Tingeling
Ranch Hand

Joined: Oct 22, 2009
Posts: 237
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46352
Embla Tingeling wrote:Doubleposted
Thank you for noticing ( ). Closing thread.
I agree. Here's the link:
subject: using an object in other class...
It's not a secret anymore!