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

Java Data Structures Exam Questions And Answers

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

JAVA DATA STRUCTURES EXAM QUESTIONS AND ANSWERS

Vista previa del contenido

JAVA DATA STRUCTURES EXAM
QUESTIONS AND ANSWERS



In Java, all arguments are passed to methods by value, except for objects and arrays. -
Correct Answers -True

Every Java class is a subclass of either another Java class or the Object class. -
Correct Answers -True

Java allows programmers to perform operations on reference values - Correct Answers
-False

In Java, multiple class inheritance is possible since a new subclass can directly inherit
the attributes (i.e. data and methods) of more than one class, including the Object class.
- Correct Answers -False

Files in Java can grow in size as needed, whereas arrays have a fixed size. - Correct
Answers -True

Which of the following is a precondition for a method that accepts a number n and
computes the nth Fibonacci number? - Correct Answers -n is a positive integer

When you solve a problem by solving two or more smaller problems, each of the
smaller problems must be ______ the base case than the original problem. - Correct
Answers -either farther from or the same "distance" from

A recursive binary search algorithm always reduces the problem size by half at each
recursive call. - Correct Answers -True

A recursive solution can have more than one base case. - Correct Answers -True

Typically, a directly recursive method requires a while or for loop. - Correct Answers -
True

A recursive method always calls itself. - Correct Answers -False

What is the effect of the following recursive Java method, assuming that N is a positive
integer?

, public static int Mystery (int N)
{
if (N > 0)
return 1 + Mystery(N / 10);
else
return 0;
} - Correct Answers -It computes the number of decimal digits in N

In the box trace for a recursive method, a new box (i.e. activation record) is created
each time: - Correct Answers -the method is called

Consider the following Java program. What is output by the program?

public static void main( void )

{

int a, b, result;

a = 3;

b = 4;

result = value( a, b );

System.out.printf("%d\n",result);

}

public static int value( int x, int n )

{

if ( n > 0 )

return x * value( x, n - 1 );

else

return 1;

} - Correct Answers -81

During the specification phase of the life cycle of software, the programmer should
indicate what enhancements to the program are likely in the future. - Correct Answers -
True

Información del documento

Subido en
28 de julio de 2025
Número de páginas
7
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$12.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.
millyphilip
3.7
(562)
Vendido
3013
Seguidores
1964
Artículos
47749
Última venta
18 horas 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