Questions and CORRECT Answers
encapsulation - CORRECT ANSWER - mechanism of wrapping the data (variables) and
code acting on the data (methods) together as as single unit. An example of this is an object of a
class with setter and getter methods. Can be thought of as a black box
visibility modifiers - CORRECT ANSWER - 1) public
2) private
3) protected
accessor method - CORRECT ANSWER - gives access to a private variable
mutator method - CORRECT ANSWER - modifies a private variable in the class
Constructor - CORRECT ANSWER - special methods which have no return type (not
even void) and must have the same name as the class.
They are used to create objects of a class and for parameter passing (if necessary)
Wrapper classes - CORRECT ANSWER - 'wrap' primitive data types/values in an object
so that the primitive data type can use methods associated with objects
Instance variables - CORRECT ANSWER - variables declared at a class level. They are
used by all methods in that class
Local variables - CORRECT ANSWER - variables declared in a method. They are used
only in that method
Overloading - CORRECT ANSWER - The process of using the same name for multiple
methods
, You can only use the same name for different methods if either the return type or parameters
passed to the method are different
Overriding - CORRECT ANSWER - You can overwrite a method that is inherited from a
parent class by redefining that method in the child class
Once the method is redefined, when it is called it will use the method defined for the subclass
instead of the on defined for the superclass
Static method - CORRECT ANSWER - cannot reference instance variables. Can
reference static variables or local variables
Static variables - CORRECT ANSWER - All objects created from the class share access
to the static variable
Changing the value of a static variable in one object changes it for all others
waterfall method - CORRECT ANSWER - 1) Establish requirements
2) Create design
3) Implement code
4) Test system
5) Deploy
white box testing - CORRECT ANSWER - focuses on the internal logic such as the
implementation of a method
Statement coverage guarantees that all statements in a method are executed
Condition coverage guarantees that all paths through a method are executed
black box testing - CORRECT ANSWER - maps a set of specific inputs to a set of
expected outputs
Test program with values that surround and fall on the boundaries as well as some general values
from the equivalence categories