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.

inside custom component

Java Development

Reply
Developer
Posts: 553
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
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-
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Java question

Google:

 

java static initializer

Developer
Posts: 553
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Re: Java question

Excellent!

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-