ptg7068951
Workshop 153
Workshop
The following questions see if you have the attributes and behavior to under-
stand OOP techniques.
Quiz
- In a Java class,a method is an example of what?
A. Attributes
B. Statements
C. Behavior - If you want to make a variable a class variable,what statement must
you use when it is created?
A. new
B. public
C. static - What is the name for the part of a program in which a variable lives?
A. Its nest
B. The scope
C. Variable valley
Answers
- C.A method is made up of statements,but it’s an example of behavior.
- C.If the staticstatement is left off,the variable is an object variable
instead of a class variable. - B.The compiler fails with an error when a variable is used outside of
its scope.