Meaningless Drivel is fun!*
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 37958
Embla Tingeling wrote:Doubleposted
Thank you for noticing ( ). Closing thread.
Consider Paul's rocket mass heater.
subject: using an object in other class...
Similar Threads
Sorting arraylist on the basis of object
q rom
ArrayList confusion
Thread - Wait() and Notify();
Object is null