aspose file tools*
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
Author

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)

hmapA.put("1",ABC);
hmapA.put("2",XYZ);
hmapA.put("3",LMN);


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...

hMapB=classA.getHashA();


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

Joined: Oct 22, 2009
Posts: 237
Doubleposted,

http://www.coderanch.com/t/472146/Beginning-Java/java/Object-null
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Embla Tingeling wrote:Doubleposted
Thank you for noticing ( ). Closing thread.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using an object in other class...