Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

CSIS 212 Final Exam Questions with Verified Solutions Latest () Already Passed

Rating
-
Sold
-
Pages
30
Grade
A+
Uploaded on
18-01-2025
Written in
2024/2025

CSIS 212 Final Exam Questions with Verified Solutions Latest () Already Passed Consider array items, which contains the values 0,2,4,6, and 8. If method changeArray is called with the method call changeArray (items, items[2]), what values are stored in items after the method has finished executing? public static void changeArray(int[] passedArray, int value) { passedArray[value] = 12; value = 5; } A. 0,2,4,6,5 B. 0,2,5,6,12 C. 0,2,4,6,12 D 0,2,12,6,8 - Answers C. 0,2,4,6,12 An argument type followed by a(n) ___________ in a method's parameter list indicates that the method receives a variable number of arguments of that particular type. A. Square Brackets ([]) B. Ellipsis (...) C. Varargs keyword D. All of the above - Answers B. Ellipsis (...) Which of the following statements is false? A. When an argument is passed by reference, the called method can access the argument's value in the caller directly but cannot modify it. B. To pass an object reference to a method, simply specify in the method call the name of the variable that refers to the object. C. To pass an individual array element to a method, use the indexed name of the array. D. All arguments in Java are passed by value. - Answers A. When an argument is passed by reference, the called method can access the argument's value in the caller directly but cannot modify it. Consider the code segment below. Which of the following statements is false? int[] g; g = new int[23]; A. The first statement declares an array reference B. The second statement creates the array C. g is a reference to an array of integers. D. The value of g[3] is -1 - Answers D. The value of g[3] is -1 Which of the following statements is true? A. When a try block terminates, any variables declared in the try block are preserved. B. You can have many catch blocks to handle different types of exceptions. C. The try block contains the code that handles the exception if one occurs. D. The catch block contains the code that might throw an exception. - Answers B. You can have many catch blocks to handle different types of exceptions. Which of the following sets of statements creates a multidimensional array with 3 rows, where the first row contains 1 value, the second row contains 4 items and the final row contains 2 items? A. int[][] items; items = new int [3][?]; items[0] = new int[1]; items[1]1 = new int[4]; items[2] = new int[2]; B. int[][] items; items[0] = new int[1]; items[1]1 = new int[4]; items[2] = new int[2]; C. int[][] items; items = new int [?][?]; items[0] = new int[1]; items[1]1 = new int[4]; items[2] = new int[2]; D. int[][] items; items = new int [3][ ]; items[0] = new int[1]; items[1]1 = new int[4]; items[2] = new int[2]; - Answers D. int[][] items; items = new int [3][ ]; items[0] = new int[1]; items[1]1 = new int[4]; items[2] = new int[2]; Which of the following tasks cannot be performed using an enhanced for loop? A. Incrementing the value stored in each element of the array B. Displaying all even element values in an array. C. Calculating the product of all the values in an array. D. Comparing the elements in an array to a specific value. - Answers A. Incrementing the value stored in each element of the array. For the array that was the correct answer in the previous question, what is the value returned by items[1][0]? A. 12 B. 4 C. 6 D. 8 - Answers C. 6 Which expression adds 1 to the element of array arrayName at index i? A. ++arrayName[i] B. arrayName++[i] C. arrayName[i++] D. None of these - Answers A. ++arrayName[i] Exception handling helps you create _____ programs. A. High-performance B. Logic-error-free C. Fault-tolerant D. Compilation-error-free - Answers C. Fault-tolerant Which of the following statements is false? A. A primitive-type variable cannot be used to invoke a method. B. A reference to an object is required to invoke an object's methods.

Show more Read less
Institution
CSIS 212
Course
CSIS 212

Content preview

CSIS 212 Final Exam Questions with Verified Solutions Latest (2025-2026) Already Passed

Consider array items, which contains the values 0,2,4,6, and 8. If method changeArray is called with the
method call changeArray (items, items[2]), what values are stored in items after the method has finished
executing?



public static void changeArray(int[] passedArray, int value)

{

passedArray[value] = 12;

value = 5;

}



A. 0,2,4,6,5

B. 0,2,5,6,12

C. 0,2,4,6,12

D 0,2,12,6,8 - Answers C. 0,2,4,6,12

An argument type followed by a(n) ___________ in a method's parameter list indicates that the method
receives a variable number of arguments of that particular type.



A. Square Brackets ([])

B. Ellipsis (...)

C. Varargs keyword

D. All of the above - Answers B. Ellipsis (...)

Which of the following statements is false?



A. When an argument is passed by reference, the called method can access the argument's value in the
caller directly but cannot modify it.

,B. To pass an object reference to a method, simply specify in the method call the name of the variable
that refers to the object.

C. To pass an individual array element to a method, use the indexed name of the array.

D. All arguments in Java are passed by value. - Answers A. When an argument is passed by reference,
the called method can access the argument's value in the caller directly but cannot modify it.

Consider the code segment below. Which of the following statements is false?



int[] g;

g = new int[23];



A. The first statement declares an array reference

B. The second statement creates the array

C. g is a reference to an array of integers.

D. The value of g[3] is -1 - Answers D. The value of g[3] is -1

Which of the following statements is true?



A. When a try block terminates, any variables declared in the try block are preserved.

B. You can have many catch blocks to handle different types of exceptions.

C. The try block contains the code that handles the exception if one occurs.

D. The catch block contains the code that might throw an exception. - Answers B. You can have many
catch blocks to handle different types of exceptions.

Which of the following sets of statements creates a multidimensional array with 3 rows, where the first
row contains 1 value, the second row contains 4 items and the final row contains 2 items?



A. int[][] items;

items = new int [3][?];

items[0] = new int[1];

, items[1]1 = new int[4];

items[2] = new int[2];

B. int[][] items;

items[0] = new int[1];

items[1]1 = new int[4];

items[2] = new int[2];

C. int[][] items;

items = new int [?][?];

items[0] = new int[1];

items[1]1 = new int[4];

items[2] = new int[2];

D. int[][] items;

items = new int [3][ ];

items[0] = new int[1];

items[1]1 = new int[4];

items[2] = new int[2]; - Answers D. int[][] items;

items = new int [3][ ];

items[0] = new int[1];

items[1]1 = new int[4];

items[2] = new int[2];

Which of the following tasks cannot be performed using an enhanced for loop?



A. Incrementing the value stored in each element of the array

B. Displaying all even element values in an array.

C. Calculating the product of all the values in an array.

Written for

Institution
CSIS 212
Course
CSIS 212

Document information

Uploaded on
January 18, 2025
Number of pages
30
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$10.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TutorJosh Chamberlain College Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
463
Member since
1 year
Number of followers
16
Documents
32222
Last sold
1 day ago
Tutor Joshua

Here You will find all Documents and Package Deals Offered By Tutor Joshua.

3.4

74 reviews

5
26
4
16
3
14
2
1
1
17

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions