Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to set and get a value

 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, please guide me i trying this one lot. Actually i have one value in a variable that variable value i have set in one program that same variable value i have to get in another program please help me(i am trying this all in core java)
 
arulk pillai
Author
Ranch Hand
Posts: 3387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean that they are running in separate JVMs? Why not persist the value to a database or a flat file? Alternatively, need to look at RMI.
 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, thanks for reply same jvm only

problem:

program A use to call program B.

i have program A in that i having callerid value that value i have to pass to program B

how to set that callerid value in program A?

how to get that callerid value in program B?

please guide me
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to be more specific with your terms. You cannot have two programs running in the same JVM. So are we talking about two separate programs (in which case, see arulk's reply) or two processes running as part of the same program ?
 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thanks for your reply. yes two processes running as part of the same program.

In program A i getting callerid value and calling program B I don't know how to pass the callerid value to program B please guide me
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why did you abandon this thread where you asked essentially the same question and got a lot of help? It wastes the time of people who are trying to help you if multiple simultaneous conversation about the same topic are going on - not a smart thing to do.
 
K. Tsang
Bartender
Posts: 3444
13
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not have a separate class that set and get the value? Then in your A/B programs can new instance this separate class and do set/get.

If that's not what you want, why not pass the value as parameter into B program. This assumes you set the value inside A locally.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic