|
-
Apr 28th, 2002, 07:44 PM
#1
Thread Starter
Hyperactive Member
Good Question: Static Data Across Apps?
if i have two SEPERATE programs run (aka. different class to the JVM of public class) and they both use a static class/class member will they see the same values or is static just static within a single program running?
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
-
Apr 29th, 2002, 03:09 AM
#2
Addicted Member
I'm pretty sure its static within the program.
Otherwise you could have all sorts of problems if you had your variable named the same as one in another program that was running.
Ford? Theres an infinite number of monkeys outside that want to talk to you about a script of hamlet they've produced!
-
Apr 30th, 2002, 02:22 AM
#3
Well ...
Originally posted by Mrs Kensington
I'm pretty sure its static within the program.
Otherwise you could have all sorts of problems if you had your variable named the same as one in another program that was running.
Buf if a Static member is available without creating an instance of a class, in CaptainPinko's example, the two classes would not be using any instance of the static class or the class having the static member, instead they would just be using whatever is there. How would the JVM track two different values for the static member?
.
-
May 1st, 2002, 01:27 PM
#4
I agree with Mrs Kensington.
I'm pretty sure that "two SEPERATE programs run - CaptainPinko", means two separate JVM's are running. What does "aka. different class to the JVM of public class" mean?
"How would the JVM... - honeybee", again I believe it would have to be that the single instance of a JVM would be keeping track of whatever was invoked by that invocation of "java SomeClass". A second invocation of "java SomeClass" or "java DifferentClass" should be in different memory spaces.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|