{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


example.final.answers - Multiple Choice 1 When a program is...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Multiple Choice 1. When a program is finished using a file, it should do this: (Pg. 244) a. Erase the file b. Close the file c. Throw an exception d. Reset the read position 2. This keyword creates an object: (Pg. 182) a. create b. object c. new d. construct 3. This type of method does not return a value: (Pg. 291) a. null b. void c. Empty d. Anonymous 4. When an exception is generated, it is said to have been: (Pg. 804) a. built b. thrown c. caught d. killed 5. Two or more methods in a class may have the same name, as long as this is different: (Pg. 356) a. their return values b. their access specifier c. their parameter lists d. their memory address 6. This array field holds the number of elements that the array has: (Pg. 538) a. size b. elements c. length d. width 7. Each element of an array is accessed by a number known as a(n): (Pg. 537) a. subscript b. size delarator c. address d. specifier 8. When an array is passed as an argument to a method, this is actually passed: (Pg. 604, modified) a. a copy of the array b. the name of the array c. a reference to the array d. None of these. You cannot pass an array. 9. This is a section of code that gracefully responds to exceptions: (Pg. 804) a. exception generator b. exception manipulator c. exception handler d. exception monitor
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Short Answer (Pgs. 360, 541, 810) 1. Assuming that array1 and array2 are both array reference variables, why is it not possible to assign the contents of the array referenced by array2 to the array referenced by array1 with the following statement? array1 = array2; By using the assignment operator on the variables, you are simply copying the reference from one array to another. In effect, both array1 and array2 will point to the same location in memory, and anything that’s changed in one will be changed in the other. Arrays must be copied element-by-element using a loop to get a true duplication of an array.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 8

example.final.answers - Multiple Choice 1 When a program is...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online