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

Java Exam Questions With All Correct Answers

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

JAVA EXAM QUESTIONS WITH ALL CORRECT ANSWERS

Vista previa del contenido

JAVA EXAM QUESTIONS WITH ALL
CORRECT ANSWERS

If you declare a variable as an instance variable within a class and you declare and use
the same variable name within a method of the class, then within the method - Answer-
The variable used inside the method takes precedence

A method variable ____ a class variable within the same name - Answer-Override

Non-ambiguous, overloaded methods must have the same - Answer-Name

If a method is written to receive a double parameter, and you assign an integer to the
method, then the method will - Answer-Work correctly, the integer will be promoted to a
double

A constructor ____ parameters - Answer-Can receive

A constructor ____ overloaded - Answer-Can be

If a class is named Student, the class constructors named is - Answer-Student

If you use the automatically supplied default constructor when you create an object -
Answer-Numeric fields are set to 0 (zero)

The code between a pair of curly braces in a method is a - Answer-Block

When a block exists within another block, the blocks are - Answer-Nested


The logical structure in which one instruction occurs after another with no branching is a
- Answer-Sequence

Which of the following is typically used in a flowchart to indicate a decision? - Answer-
Diamond

Which of the following is not a type of it statement? - Answer-Reserve if

A decision is based on a(n) ____ value - Answer-Boolean

, In Java, the value of (4 > 7) is ____. - Answer-False

Assuming the variable q has been assigned the value 3, which of the following
statements displays XXX? - Answer-if ( q >7);
System.out.println("XXX");

What is the output of the following code segment?
t = 10
if ( t > 7)
System.out.print("AAA");
System.out.print("BBB"); - Answer-AAA

What is the output of the following code segment?
t=7
if (t > 7)
System.out.print("AAA");
System.out.print("BBB"); - Answer-BBB

When you code an if statement within another if statement, as in the following then the if
statements are ____.
if (a > b)
if (c > d) x = 0; - Answer-Nested

The operator that combines two conditions into a single Boolean value that is true only
when both of the conditions are true, but is false other wise, is ____. - Answer-&&

The operator that combines two conditions into a single Boolean value that is true when
at least one of the conditions is true is ____. - Answer-||

Which of the following groups has the lowest operator precedence? - Answer-Logical
OR

Which of the following displays "Error" when a student ID is less than 1000 or more than
9999? - Answer-if (stuID < 1000 )
System.out.println("Error");
else
if (stuID > 9999)
System.out.println("Error");

You can use the statement to terminate a switch structure - Answer-break

The argument testing in a switch structure can be any of the following except a(n) ____.
- Answer-double

Assuming a variable w has been assigned to the value 15, what does the following
statement do?

Información del documento

Subido en
12 de julio de 2025
Número de páginas
6
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$13.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.
Scholarsstudyguide
3.8
(169)
Vendido
853
Seguidores
476
Artículos
16409
Ú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