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

Java Practice UPDATED ACTUAL Exam Questions and CORRECT Answers

Document preview thumbnail
Vista previa 3 fuera de 26 páginas

Java Practice UPDATED ACTUAL Exam Questions and CORRECT Answers Which of the following correctly defines and instantiates an array that can store 30 integers? - CORRECT ANSWER - int[] array = new int[30]; What is output by the code below? - 10 int[] array = {33,14,37,11,27,4,6,2,6,7}; Sln(h); - CORRECT

Vista previa del contenido

Java Practice UPDATED ACTUAL Exam
Questions and CORRECT Answers
Which of the following correctly defines and instantiates an array that can store 30 integers? -
CORRECT ANSWER - int[] array = new int[30];


What is output by the code below?


int[] array = {33,14,37,11,27,4,6,2,6,7}; System.out.println(array.length); - CORRECT
ANSWER - 10


What is output by the code below?


int[] array = {7,8,10,11,4,3};


array[array[0]/2]=15;


array[array[4]+1]=9;


array[array.length/3+2]=5;


array[1]=array[0]+4;


System.out.println(array[4]); - CORRECT ANSWER -6


What is output by the code below?


int[] array = {5,10,3,6,9,15};

,for(int i=0; i<array.length/2; i=i+2)


{


array[i]=array[array.length-i-2];


}


System.out.println(array[0]); - CORRECT ANSWER -9


What is output by the code below?


String[] ray = {"abc","ade","123","234","678"};


System.out.println(ray[ray.length-2]); - CORRECT ANSWER - 234


What is output by the code below?


String[] ray = {"abc","ade","123","234","678"};


System.out.println(ray[3].substring(0,2) + ray[4].charAt(1)); - CORRECT ANSWER - 237


What is output by the code below?


String[] ray = {"abc","ade","123","234","678"};


System.out.println(ray[1].charAt(2)); - CORRECT ANSWER -e

, What is output by the code below?


int[] nums = new int[10];


for (int i=0; i < nums.length; i++)


{


nums[i] = i*2;


}


System.out.println(nums[9]); - CORRECT ANSWER - 18


What is returned by method bot given the call shown below?


//client code in the runner or main method


int[] sRay = {9,9,7,1,2,3,4,5,6,2,2,3,7,3};


System.out.println( bot(sRay) );


//method bot


public static int bot( int[] ray )


{

Información del documento

Subido en
17 de abril de 2025
Número de páginas
26
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$12.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.
STANFORDGRADESS
4.0
(242)
Vendido
1707
Seguidores
109
Artículos
123758
Última venta
23 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