how to pass class variable to another class

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Mar 2006
Posts: 112
Reputation: Covinus is an unknown quantity at this point 
Solved Threads: 0
Covinus's Avatar
Covinus Covinus is offline Offline
Junior Poster

how to pass class variable to another class

 
0
  #1
Jan 30th, 2007
i need to access a variable from a class to another class currently running at the same time. my plan is to:

Save the values of the variable to a file and access it from the other class

other options i have
Use a database

use RMI

what other features in java that i can use??? what do you think is my best option???

Note:

the variable must not be static because i need to change it from time to time
if you cant hit 2 birds with one stone try hitting just one or you will end up with nothing at all
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 112
Reputation: Covinus is an unknown quantity at this point 
Solved Threads: 0
Covinus's Avatar
Covinus Covinus is offline Offline
Junior Poster

Re: how to pass class variable to another class

 
0
  #2
Jan 30th, 2007
not even 1 reply
if you cant hit 2 birds with one stone try hitting just one or you will end up with nothing at all
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: how to pass class variable to another class

 
0
  #3
Jan 30th, 2007
impossible to say without knowing more context.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 112
Reputation: Covinus is an unknown quantity at this point 
Solved Threads: 0
Covinus's Avatar
Covinus Covinus is offline Offline
Junior Poster

Re: how to pass class variable to another class

 
0
  #4
Jan 30th, 2007
Well lets say

CLass A is a class that holds a button. and everytime i click it a boolean var would be give a value True.

Class B is a class that draws shape into a canvas. but it will only draw if the boolean variable in CLass A is true. after it has finished drawing the shape it will Access Class A's boolean variable and give it a value of false
if you cant hit 2 birds with one stone try hitting just one or you will end up with nothing at all
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 9032 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC