Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Carrier: Movistar, Telenor
Accepted Solution

Java question

In the sample on persistentstorage the following piece of code exists. Its not a class or a function?

 

---------------------------------------

 

   static
    {
      store = PersistentStore.getPersistentObject(0xdec6a67096f833cL);
      synchronized (store)
       {
         if (store.getContents() == null)
          {
            store.setContents(new Vector());
            store.commit();
          }
       }
      _data = new Vector();
      _data = (Vector) store.getContents();
    }

 

-----------------------------------

 

when and why is it executed?

 

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Please use plain text.
Developer
peter_strange
Posts: 17,695
Registered: ‎07-14-2008

Re: Java question

Google:

 

java static initializer

Please use plain text.
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Carrier: Movistar, Telenor

Re: Java question

Excellent!

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Please use plain text.