and CORRECT Answers
Implements - CORRECT ANSWER - -Holds between an interface and a class
-Class has the method bodies for contracts in an interface
Extends - CORRECT ANSWER - -Holds between two classes or two interfaces
-Start out with all the contracts or bodies from the previous class/interface
-Purpose: Add method bodies, override methods, overload methods
-If B extends A, B inherits all of the method bodies in A
Precondition - CORRECT ANSWER - -Client is responsible for meeting requirements
-Implementer can assume that it is being met
-"Requires clause"
***IF THE PRECONDITION IS FALSE, THE FUNCTION CAN LITERALLY DO
ANYTHING INCLUDING NOT TERMINATE
Postcondition - CORRECT ANSWER - -Implementer is responsible for meeting
requirements
-Client can assume that it is being met
-"Ensures clause"
Override - CORRECT ANSWER - -2 methods with same name and parameters, where one
is in the parent class and one is in the child class
Overload - CORRECT ANSWER - -2+ methods in a class with the same name and
different parameters
, 4 types of parameter modes - CORRECT ANSWER - 1. Restores - Outgoing value =
Incoming value
***THIS IS THE DEFAULT MODE
2. Clears - Incoming value = 0
3. Replaces - Independent of incoming value
(Ex: x=z)
4. Updates - Dependent on incoming value
(Ex: x=x+6)
Reference types - CORRECT ANSWER - Mutable
Immutable
Type - CORRECT ANSWER - Name of the set for all values a variable with this type can
have. Each type has a mathematical type that models it
Main Method Syntax - CORRECT ANSWER - public static void main(String[] args)
Compiler - CORRECT ANSWER - Checks source code (.java) and generates byte code
(.class)
2 Types of Variables - CORRECT ANSWER - 1. Program Variable - May change during
execution
2. Mathematical Variable - Arbitrary, fixed value
Statement - CORRECT ANSWER - 1. Simple statement - Ends with a semi colon
2. Compound statement - Block
3. Control statement - If/else-if/while
Expression - CORRECT ANSWER - Any code fragment that has a value