• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 199 páginas
Examen

Test Bank for Starting Out with Java: Control Structures through Objects, 8th edition by Gaddis

Document preview thumbnail
Vista previa 4 fuera de 199 páginas

Test Bank for Starting Out With Java: Control Structures through Objects, 8th edition 8e by Tony Gaddis. Full Chapters test bank are included - Chapter 1 to 16 Introduction to Computers and Java Java Fundamentals Decision Structures Loops and Files Methods A First Look at Classes Arrays and the ArrayList Class A Second Look at Classes and Objects Text Processing and Wrapper Classes Inheritance Exceptions and Advanced File I/O JavaFX: GUI Programming and Basic Controls JavaFX: Advanced Controls JavaFX: Graphics, Effects, and Media Recursion Databases

Vista previa del contenido

Test Bank for Starting Out with Java: Control Structures
through Objects, 8th edition by Gaddis


1. What does the `main` method header look like?
A) `public void main(String args)`
B) `public static void main(String[] args)`
C) `static public main(String[] args)`
D) `public main(String[] args)`
Answer: B
Rationale: The JVM calls `public static void main(String[] args)` as the entry point.




2. Which data type stores a single character?
A) `String`
B) `char`
C) `boolean`
D) `int`
Answer: B
Rationale: `char` holds one Unicode character; `String` holds a sequence.




3. What is the result of `` in Java?
A) 3.5
B) 3

,C) 4
D) 3.0
Answer: B
Rationale: Integer division truncates the decimal; both operands are `int`.




4. Which operator gives the remainder?
A) `/`
B) `%`
C) `*`
D) `+`
Answer: B
Rationale: `%` is the modulus operator; it returns the remainder.




5. What is the value of `x` after `int x = 5; x += 3;`?
A) 5
B) 3
C) 8
D) 2
Answer: C
Rationale: `+=` adds the right operand to the variable; 5 + 3 = 8.




6. Which of these is a valid `if` statement?
2

,A) `if x > 5 then`
B) `if (x > 5)`
C) `if x > 5`
D) `if (x > 5) then`
Answer: B
Rationale: Java requires parentheses around the condition.




7. What is the output of `System.out.println("Hello" + 5 + 3);`?
A) `Hello53`
B) `Hello8`
C) `Hello 5 3`
D) `8Hello`
Answer: A
Rationale: Left-to-right: `"Hello" + 5` → `"Hello5"`; then `+ 3` → `"Hello53"`.




8. Which loop always executes at least once?
A) `for`
B) `while`
C) `do-while`
D) `foreach`
Answer: C
Rationale: `do-while` checks the condition after the body.


3

, 9. What is the correct way to declare an array of 10 ints?
A) `int[] arr = new int[10];`
B) `int arr = new int[10];`
C) `int arr[10];`
D) `array int arr[10];`
Answer: A
Rationale: Java syntax: `type[] name = new type[size];`.




10. What does `arr.length` return?
A) Last index
B) Number of elements
C) Size in bytes
D) First element
Answer: B
Rationale: `.length` gives the array’s capacity, not the last index.




11. Which method compares two strings for equality?
A) `==`
B) `equals()`
C) `compare()`
D) `equalsIgnoreCase()`
Answer: B
4

Información del documento

Subido en
25 de septiembre de 2026
Número de páginas
199
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$21.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
AcademicACHIEVER
3.4
(115)
Vendido
654
Seguidores
26
Artículos
14200
Última venta
1 hora hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes