Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is a static variable in Java?
Think about how instance variables relate to class-level storage.
What is the significance of static initialization blocks?
Recall how they run before any instances are created.
What is the primary purpose of the Initialization phase?
Think about the stages of class loading.
True or False: Static variables are initialized at runtime.
Recall when class loading occurs.
Write a Java class demonstrating static variable initialization and static blocks, focusing on the order of execution. What will be displayed when the class is loaded?
Consider the execution order during loading.
Discuss the implications of having multiple static blocks in a class, especially in terms of variable dependencies.
Think about how one block can set up values for another.
5 more questions in this section. Enroll free to practise them all.
Enroll free