Chapter 5 Test Review
description
Transcript of Chapter 5 Test Review
Multiple Choice and True/False
• Effect of assignment operation for primitives and objects (addresses)
• Differences between primitives and objects• Use of null assignment
– What types of variables can use the null assignment
• Effect of assignment operations when variable or objects passed to class methods.
• Exceptions
Multiple Choice and True/False
• Static methods and variables– what are they– what they can and can’t do– result of using them
• Use of this reserved word• Interfaces
– what are they– how to write them– how to use them
• Implementing Comparable interface
Free-form questions
• Explain why aliases can cause trouble for programmers who are not aware of them. Example.
• Know types of exceptions, when they arise, example for each. – ArithmeticException - An arithmetic operation could not take place
because of an illegal action such as division by zero or square root of a negative number
– NullPointerException - An object was not instantiated (it had the value null) before a message was passed to it
– IndexOutOfBoundsException - A numeric parameter used as an index into an object
• Example: an array, String or Vector was out of range, such as charAt(-1)