Chapter 5 Test Review

5
Chapter 5 Test Review 16 Multiple Choice 16 True/False 6 Short Answer 57 points total

description

Chapter 5 Test Review. 16 Multiple Choice 16 True/False 6 Short Answer 57 points total. Multiple Choice and True/False. Effect of assignment operation for primitives and objects (addresses) Differences between primitives and objects Use of null assignment - PowerPoint PPT Presentation

Transcript of Chapter 5 Test Review

Chapter 5 Test Review

•16 Multiple Choice •16 True/False•6 Short Answer•57 points total

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)

Free-form questions

• Assignment and comparison statements– how are they handled differently for primitives and objects

• Reasons for and examples of data and methods declared static.

• Implement compareTo method• Writing a static method• Define an interface class.