Back to marketplace

Static variables and constants

No description yet. This curated deck is ready for daily study.

Total cards: 3•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (3)

#1
Front (Question)

Static variable definition:

Back (Answer)

an attribute that belongs to a class as a whole, not to individual objects (instances) of that class. Such an attribute is represented by a variable called static variable or class, which is declared with the keyword static

#2
Front (Question)

Static methods (methods that do not involve any particular instances of a class) cannot access or modify any instance variables and cannot refer to _____, because _____ is undefined when a static method is running

Back (Answer)

this

#3
Front (Question)

When a parameter is passed by value, the method works with a copy of the variable passed to it, so it has no way of changing the value of the original. What will be returned by: int x = 3, y = 5 fun(x, y) System.out.println(x + “ “ + y)

Back (Answer)

3, 5 Note that no matter what fun(x, y) actually does, it will not affect the values of x and y because it is only working with a copy