• ¿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 2 fuera de 14 páginas
Examen

Java Chapter 2 Test Questions and Answers| Latest Update 100% Solved

Document preview thumbnail
Vista previa 2 fuera de 14 páginas

Java Chapter 2 Test Questions and Answers| Latest Update 100% Solved

Vista previa del contenido

Java Chapter 2 Test Questions and Answers|
Latest Update 100% Solved
Which of the following does not describe a valid comment in Java?
A) Single line comments, two forward slashes - //
B) Multi-line comments, start with /* and end with */
C) Multi-line comments, start with */ and end with /*

D) Documentation comments, any comments starting with /** and ending with */ ✔️✔️C) multi-
line comments, start with */ and end with /*


Which of the following statements correctly creates a Scanner object for keyboard input?
A) Scanner kbd = new Scanner(System.keyboard);
B) Scanner keyboard(System.in);
C) Scanner keyboard = new Scanner(System.in);

D) Keyboard scanner = new Keyboard(System.in); ✔️✔️C) Scanner keyboard= new
Scanner(System.in);


Which Scanner class method reads an int?
A) readInt()
B) nextInt()
C) getInt()

D) read_int() ✔️✔️B) nextInt()


Which Scanner class method reads a String?
A) readString()
B) nextString()
C) getString()

, D) nextLine() ✔️✔️D) nextLine()


Which one of the following methods would you use to convert a string to a double?
A) Byte.ParseByte
B) Long.ParseLong
C) Integer.ParseInt

D) Double.ParseDouble ✔️✔️D) Double.ParseDouble



T/F:A Java program will not compile unless it contains the correct line numbers. ✔️✔️FALSE



T/F: All Java statements end with semicolons. ✔️✔️FALSE



T/F: Java is a case-insensitive language. ✔️✔️FALSE


T/F: Although the dollar sign is a legal identifier character, you should not use it because it is
normally used

for special purposes. ✔️✔️TRUE


T/F: Assuming that pay has been declared a double, the following statement is valid.

pay = 2,583.44; ✔️✔️FALSE


T/F: Named constants are initialized with a value, that value cannot be changed during the
execution of the

program. ✔️✔️TRUE



T/F: A variable's scope is the part of the program that has access to the variable. ✔️✔️TRUE

Información del documento

Subido en
21 de marzo de 2025
Número de páginas
14
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$9.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.
KateJones
4.8
(12)
Vendido
32
Seguidores
0
Artículos
5716
Última venta
4 semanas 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