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

Java Chapter 5 Exam Questions and Answers All Correct

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

Java Chapter 5 Exam Questions and Answers All Correct

Vista previa del contenido

Java Chapter 5 Exam Questions
and Answers All Correct

A special variable that holds a value being passed into a method is called what?
A) Modifier
B) Parameter
C) Alias
D) Argument - Answer-Answer: B

When you pass an argument to a method, be sure that the argument's data type is
compatible with:
A) the parameter variable's data type
B) the method's return type
C) the version of Java currently being used
D) IEEE standards - Answer-Answer: A

A parameter variable's scope is:
A) the method in which the parameter is declared
B) the class to which the method belongs
C) the main method
D) All of the above - Answer-Answer: A

The lifetime of a method's local variable is:
A) the duration of the program
B) the duration of the class to which the method belongs
C) the duration of the method that called the local variable's method
D) only while the method is executing - Answer-Answer: D

Local variables:
A) are hidden from other methods
B) may have the same name as local variables in other methods
C) lose the values stored in them between calls to the method in which the variable is
declared
D) All of the above - Answer-Answer: D

Which of the following values can be passed to a method that has an int parameter
variable?
A) float

, B) double
C) long
D) All of the above
E) None of the above - Answer-Answer: E

The header of a value-returning method must specify this.
A) The method's local variable names
B) The name of the variable in the calling program that will receive the returned value
C) The data type of the return value
D) All of the above - Answer-Answer: C

What will be returned from the following method?
public static double methodA()
{
double a = 8.5 + 9.5;
return a;
}
A) 18.0
B) 18 (as an integer)
C) 8
D) This is an error. - Answer-Answer: A

In a @return tag statement the description:
A) cannot be longer than one line
B) describes the return value
C) must be longer than one line
D) describes the parameter values - Answer-Answer: B

When a method tests an argument and returns a true or false value, it should return:
A) a zero for true and a one for false
B) a boolean value
C) a zero for false and a non-zero for true
D) a method should not be used for this type test - Answer-Answer: B

The phrase divide and conquer is sometimes used to describe:
A) the backbone of the scientific method
B) the process of dividing functions
C) the process of breaking a problem down into smaller pieces
D) the process of using division to solve a mathematical problem - Answer-Answer: C

In a general sense, a method is:
A) a plan
B) a statement inside a loop
C) a comment
D) a collection of statements that performs a specific task - Answer-Answer: D

Información del documento

Subido en
12 de julio de 2025
Número de páginas
9
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$13.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.
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