GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

Static Variables

BLU BLU Deutsch 6 Karten

Karten in diesem Stapel (6)

  1. 1How does a static variable works ?- Once declared, a single copy of the variable is created and shared amongst all objects
    - essentially, global variables
    - Can be accessed using class reference
  2. 2Where is the reference variable placed memory wise?In Stack memory
  3. 3Where is the object saved memory wise?In Heap Memory
  4. 4Where is the static variable been saved and when does it loads?Static variable belongs to the class. Gets loaded in the class area when the class loads
  5. 5Static Methods- Belongs to the class rather than an object of a class
    - Direct access using the class name
    - Can access static data members only and can change their values
  6. 6Static Blocks- Used to initialize static variables
    - Gets executed exactly once, wehen the class is first loaded, thus they are executed before main method
    - Can access static data members and can change their values

Informationen

Beschreibung
Karteikarten am Static Variables, erstellt von BLU BLU am 23/01/2025.
Erstellt von
BLU BLU
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck