File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

using an object in other class...

 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 237
 
Campbell Ritchie
Sheriff
Pie
Posts: 47253
52
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Embla Tingeling wrote:Doubleposted
Thank you for noticing ( ). Closing thread.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic