• ¿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 65 páginas
Examen

CS 1101 Programming 1 JAVA All Self | Questions And Answers | Updated Study Solutions

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

CS 1101 Programming 1 JAVA All Self | Questions And Answers | Updated Study Solutions

Vista previa del contenido

CS 1101 Programming 1 JAVA All Self | Questions
And Answers | Updated Study Solutions

Student hint: Use an online compiler such as https://www.tutorialspoint.com/compile_java_online.php for testing most of the
code required output. Change class to public class.

Self Quiz 1
Question 1
Correct
Mark 1.00 out of 1.00
Question text

Which of the following should be used to compare the contents of two String objects in Java?
Select one:
a. =
b. ==
c. cmp

d. equals
e. ?
Feedback
Your answer is correct.
"=" is for assignment. "==" compares the memory locations of String objects, not their contents.
"cmp" is a command from Python, not Java. "?" Is the conditional operator. Use "s1.equals(s2)" to
compare the contents of String "s1" and "s2". See Section 2.3.3 of Eck (2014).
The correct answer is: equals
Question 2
Correct
Mark 1.00 out of 1.00
Question text

Consider the following line of Java code.
System.out.println("Hello, World!");
"System" is which of the following?




Select one:

,a. a class
b. a method (subroutine)
c. an object
d. a parameter
e. a statement
Feedback
Your answer is correct.
"System" is a built-in Java class with static member objects, like "out". See Section 2.3.1 of Eck
(2014).
The correct answer is: a class




Question 3
Correct
Mark 1.00 out of 1.00
Question text

Consider the following line of Java code.
System.out.println("Hello, World!");
The full line of code is which of the following?
Select one:
a. a class
b. a method (subroutine)
c. an object
d. a parameter

e. a statement
Feedback
Your answer is correct.
See Section 2.1 of Eck (2014).
The correct answer is: a statement
Question 4
Correct
Mark 1.00 out of 1.00
Question text

,What does a Java compiler do?
Select one:
a. Runs Java programs
b. Translates byte code in ".class" files into machine language
c. Translates source code in ".class" files into machine language

d. Translates source code in ".java" files into Java byte code in ".class" files
e. Translates source code in ".java" files into machine language
Feedback
Your answer is correct.
The correct answer is: Translates source code in ".java" files into Java byte code in ".class" files
Question 5
Incorrect
Mark 0.00 out of 1.00
Question text

Which of the following is NOT a valid identifier in Java?
Select one:
a. p

b. Public
c. public
d. public23
e. PuBlIc_tWeNtY_3
Feedback
Your answer is incorrect.
"public" is a reserved word in Java and cannot be used as an identifier. See Section 2.2 of Eck
(2014).
The correct answer is: public




Self Quiz 2
Question 1
Correct
Mark 1.00 out of 1.00
Question text

, Assume "test" is a boolean variable. Which of the following expressions is equivalent to "test
== true"?
Select one:

a. test
b. !test
c. test = true
d. test.equals(true)
Feedback
Your answer is correct.
See Section 3.3.2 of Eck (2014).
The correct answer is: test

Question 2
Correct
Mark 1.00 out of 1.00
Question text

Which of the following keywords is useful for getting out of an infinite loop?
Select one:

a. break
b. continue
c. do
d. switch
e. while
Feedback
Your answer is correct.
See Section 3.3.3 of Eck (2014).
The correct answer is: break
Question 3
Correct
Mark 1.00 out of 1.00
Question text

Which of the following keywords is useful for processing lists of menu options?

Información del documento

Subido en
10 de junio de 2025
Número de páginas
65
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$18.49

¿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.
Nipsey
4.1
(377)
Vendido
2132
Seguidores
1529
Artículos
15244
Última venta
1 semana 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