• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to set and get a value

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Author
Posts: 3473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Grow a forest with seedballs and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic