| | |
how to pass class variable to another class
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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
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
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
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
![]() |
Similar Threads
- Reading an input file as a class memeber function (C++)
- how to pass non-static variable to main method (Java)
- Constructor (Java)
- Array Values not found in Methods (Java)
- Template class (C)
- I'm failing my spanish class :-( (Geeks' Lounge)
Other Threads in the Java Forum
Views: 9032 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Java
actionlistener android api apple applet application arguments array arrays automation binary bluetooth character chat class classes client code component consumer database desktop developmenthelp draw eclipse encode error event exception file fractal ftp game givemetehcodez graphics gui helpwithhomework html ide image input integer j2me java javac javaee javaprojects jmf jni jpanel julia lego linked linux list loop mac map method methods mobile netbeans newbie number object online oracle print printf problem program programming project properties recursion researchinmotion rotatetext rsa scanner score screen server set size sms socket sort sql string swing template test threads time transfer tree update windows working xstream






