Static class - one per JVM or one per app?

Discussion in 'Java' started by junk1@davidbevan.co.uk, Dec 20, 2004.

  1. Guest

    I have a class called MyClass that contains a static variable (myVar).

    I have two J2EE apps running on WebSphere under the same JVM,
    MyFirstApp and MySecondApp. From MyFirstApp i set the value of myVar by
    doing MyClass.setMyVar(3).

    .....what will be the value of MyClass.getMyVar() when run from
    MySecondApp?

    ie - will the static var have scope across the whole JVM or just the
    web app?

    Thanks

    David Bevan

    http://www.davidbevan.co.uk
     
    , Dec 20, 2004
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S01aX3N0YXRl?=

    Quick one - Is SESSION per browser instance or per IP Address?

    =?Utf-8?B?S01aX3N0YXRl?=, Apr 4, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    6,322
    gerry
    Apr 10, 2006
  2. Razvan
    Replies:
    1
    Views:
    571
    tony vee
    Sep 10, 2004
  3. SaravanaKumar
    Replies:
    6
    Views:
    9,904
    Tony Morris
    Oct 19, 2004
  4. Replies:
    5
    Views:
    3,114
  5. bugbear
    Replies:
    4
    Views:
    651
    bugbear
    Aug 23, 2006
  6. Robin
    Replies:
    0
    Views:
    552
    Robin
    Jun 6, 2007
  7. Richard Maher
    Replies:
    8
    Views:
    752
    Richard Maher
    May 12, 2009
  8. Michael Schuerig
    Replies:
    6
    Views:
    279
    Robert Dober
    Feb 26, 2007
Loading...