• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 248 pages
Exam (elaborations)

Full Practice Test Bank Data Structures and Algorithms in Java, 6th Edition.pdf

Document preview thumbnail
Preview 4 out of 248 pages

Full Practice Test Bank Data Structures and Algorithms in Java, 6th E

Content preview

Full Practice Test Bank: Data Structures and
Algorithms in Java, 6th Edition


Authors: Michael T. Goodrich, Roberto
Tamassia, Michael H. Goldwasser
Publisher: Wiley
Edition: 6th Edition (2014)
ISBN: 978-1-118-77133-4


Content Coverage: All 15 chapters, with 250+
multiple-choice questions, verified answers,
and detailed rationales.




CHAPTER 1: JAVA PRIMER



1

,Q1. Which of the following is a primitive data
type in Java?


A) String
B) Integer
C) int
D) Array


Answer: C) int
Rationale: `int` is one of the eight primitive
data types in Java (byte, short, int, long, float,
double, boolean, char). `String` and `Integer`
are classes (reference types), and arrays are
objects.


Q2. What is the range of a Java `int`?



2

,A) -128 to 127
B) -32,768 to 32,767
C) Approximately -2.1 billion to +2.1 billion
D) Approximately -9.2 quintillion to +9.2
quintillion


Answer: C) Approximately -2.1 billion to +2.1
billion
Rationale: A Java `int` is a 32-bit signed
integer, giving a range of -2,147,483,648 to
2,147,483,647.


Q3. Which of the following correctly declares
and initializes an array of 10 integers?


A) int[] arr = new int(10);
B) int arr[] = new int[10];


3

, C) int[] arr = int[10];
D) array<int> arr = new array(10);


Answer: B) int arr[] = new int[10];
Rationale: In Java, arrays are declared using
`type[] name` or `type name[]`, and
instantiated with `new type[size]`. Option A is
incorrect because parentheses are used for
constructors of classes, not arrays.


Q4. What will be the output of the following
code fragment?


```java
int a = 0;
int b = 10;
while (a < b) {


4

Document information

Uploaded on
October 14, 2026
Number of pages
248
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$50.99

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

Seller avatar
slinkmuhindi
5.0
(1)
Sold
5
Followers
1
Items
1065
Last sold
2 weeks ago



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