Hi Friends, I have this line ctx.put("name", xobj ); in my program1 and I like to call xobj in another program how can I call it in program2(two seperate programs)? Am I clear? thanks, Elahe
Please clarify your question. Do you mean: I have an object in a HashMap (or similar construct) in one program (object). I want to access that object from a different program (object). How do I do this? Possible Answer: The HashMap in the first program (object) either needs to be constructed with the proper access (public, protected, or default (package)), or you need to create a "get" method in the first program with the proper access (public, ...) that the second program (object) can access. One scenario:
Or do you mean: I type "java Program1" in which I create an object such as an ArrayList. Then I type "java Program2" in another DOS window and try to access the ArrayList you created in Program1 ??
This senario is only possible if you persist your object (save it to the hard drive, for instance).
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt