Computer Science : Parameter Declarations

Study concepts, example questions & explanations for Computer Science

varsity tutors app store varsity tutors android store

Example Questions

Example Question #181 : Computer Science

What keyword is needed to create a class variable? 

Possible Answers:

final

abstract

static

private

Correct answer:

static

Explanation:

The static modifier makes the variable visible to the entire class, including the various methods in the program. Final just means that variable shall not be changed through out the code. Private just changes visibility not accessibility. For a variable to be abstract, the method itself would need to abstract and that doesn't really influence accessibility.

Learning Tools by Varsity Tutors