C201 FINAL EXAM QUESTIONS AND ANSWERS
What are the 3 Elements of class definition - Answers -attributes
constructors
methods
What are the 3 types of errors - Answers -syntax
logical
run-time
What are the 3 parts that must match in the arguments and signature of a method -
Answers -return
type
name
What are the 3 parts of a loop - Answers -INITIALIZATION; CONDITION;
AFTERTHOUGHT
What are the 3 main design principles of object-orientated programming - Answers -
Polymorphism
Inheritance
Encapsulation
What are the 3 elements of a constructor - Answers -modifier
name
argument
Explain casting - Answers -taking an Object of one particular type and "turning it into"
another Object type.
Explain overload - Answers -Overloading in Java is the ability to define more than one
method with the same name in a class.
Explain override - Answers -in object-oriented programming, is a language feature that
allows a subclass or child class to provide a specific implementation of a method that is
already provided by one of its superclasses or parent classes.
Explain static - Answers -means that the variable or function is shared between all
instances of that class as it belongs to the type,
Explain A sentinel - Answers -It is simply any constant of your choosing that is not a
legitimate value in a data set, so you can use it to mark the end of a sequence
Explain Mutator - Answers -is a method used to control changes to a variable
What are the 3 Elements of class definition - Answers -attributes
constructors
methods
What are the 3 types of errors - Answers -syntax
logical
run-time
What are the 3 parts that must match in the arguments and signature of a method -
Answers -return
type
name
What are the 3 parts of a loop - Answers -INITIALIZATION; CONDITION;
AFTERTHOUGHT
What are the 3 main design principles of object-orientated programming - Answers -
Polymorphism
Inheritance
Encapsulation
What are the 3 elements of a constructor - Answers -modifier
name
argument
Explain casting - Answers -taking an Object of one particular type and "turning it into"
another Object type.
Explain overload - Answers -Overloading in Java is the ability to define more than one
method with the same name in a class.
Explain override - Answers -in object-oriented programming, is a language feature that
allows a subclass or child class to provide a specific implementation of a method that is
already provided by one of its superclasses or parent classes.
Explain static - Answers -means that the variable or function is shared between all
instances of that class as it belongs to the type,
Explain A sentinel - Answers -It is simply any constant of your choosing that is not a
legitimate value in a data set, so you can use it to mark the end of a sequence
Explain Mutator - Answers -is a method used to control changes to a variable