Computer Science : Parameter Declarations

Study concepts, example questions & explanations for Computer Science

varsity tutors app store varsity tutors android store

Example Questions

Example Question #31 : Program Implementation

What keyword is needed to create a class variable? 

Possible Answers:

private

abstract

static

final

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