Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is a variable in programming?
Think about what it means to store something in a box.
Write the declaration of an integer variable named number.
You need to specify the data type first.
What does the keyword 'static' indicate in a variable declaration?
Think about how instances interact with class members.
True or False: Instance variables are shared among all instances of a class.
Consider if multiple objects can share something.
Create a Java program that uses all three types of variables (local, instance, and static) and demonstrate their usage.
Think about how to use these variables to store and manipulate data across methods and instances.
Write a code snippet that shows the difference in memory usage between a primitive and non-primitive variable.
Refer back to how data types affect memory allocation.
4 more questions in this section. Enroll free to practise them all.
Enroll free