Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 12 páginas
Examen

ITCS 1213 UNCC FINAL EXAM QUESTIONS WITH COMPLETE SOLUTION GRADED A+

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

ITCS 1213 UNCC FINAL EXAM QUESTIONS WITH COMPLETE SOLUTION GRADED A+ Is it possible to create an array in Java where the first row has 5 elements, the second row has 6 elements and the third row has 2 elements? - ANSWERyes create a for loop to execute: Is it possible to create an array in Java where the first row has 5 elements, the second row has 6 elements and the third row has 2 elements? - ANSWERdouble [] [] salaries = new double [NUM_STORES][]; array[0] = new double [5]; array[1] = new double [6]; array[2] = new double [2]; Write the statement to print the number of elements in a one-dimensional array. - ANSWERfor(i =0; ih -1; i++) { Sln(array[i]); } What does Java initialize the elements of an array of references to? - ANSWERnull What does Java initialize an array of ints to? - ANSWER0 Is an array an object? - ANSWERYes int [ ] numbers = new int[16] how many objects were created? - ANSWER1, new was used once Student [ ] roster = new Student[25] - how many objects were created? - ANSWER1, new was used once Write the command to compile a source code file named B - ANSWERjavac B Write the command to run a class file named B - ANSWERjava Book Where does the execution of a Java project begin? - ANSWERpublic static void main(String [] args) How many public classes can a Java class file contain? - ANSWER1 Can you declare fields of a class inside a method? - ANSWERNo What does private access for a field mean? - ANSWEROnly the current class will have access to the field or method. What does public access for a field mean? - ANSWERAny class can refer to the field or call the method. What does protected access for a field mean? - ANSWEROnly the current class and sub classes (and sometimes also same-package classes) of this class will have access to the field or method. What happens if you do not specify the access for a field? - ANSWERIt will set the access to package Can a sub-class also be a super-class? - ANSWERYes, Java allows this What is an abstract method? - ANSWERIt is a method that is declared, but contains no implementation

Vista previa del contenido

ITCS 1213 UNCC FINAL EXAM QUESTIONS WITH
COMPLETE SOLUTION GRADED A+

Is it possible to create an array in Java where the first row has 5 elements, the second
row has 6 elements and the third row has 2 elements? - ANSWER>>yes


create a for loop to execute: Is it possible to create an array in Java where the first
row has 5 elements, the second row has 6 elements and the third row has 2 elements?
- ANSWER>>double [] [] salaries = new double [NUM_STORES][];
array[0] = new double [5];
array[1] = new double [6];
array[2] = new double [2];


Write the statement to print the number of elements in a one-dimensional array. -
ANSWER>>for(i =0; i<array.length -1; i++)
{
System.out.println(array[i]);
}


What does Java initialize the elements of an array of references to? - ANSWER>>null


What does Java initialize an array of ints to? - ANSWER>>0


Is an array an object? - ANSWER>>Yes


int [ ] numbers = new int[16] how many objects were created? - ANSWER>>1, new was
used once


Student [ ] roster = new Student[25] <- how many objects were created? - ANSWER>>1,
new was used once

, Write the command to compile a source code file named Book.java - ANSWER>>javac
Book.java


Write the command to run a class file named Book.class - ANSWER>>java Book


Where does the execution of a Java project begin? - ANSWER>>public static void
main(String [] args)


How many public classes can a Java class file contain? - ANSWER>>1


Can you declare fields of a class inside a method? - ANSWER>>No


What does private access for a field mean? - ANSWER>>Only the current class will
have access to the field or method.


What does public access for a field mean? - ANSWER>>Any class can refer to the field
or call the method.


What does protected access for a field mean? - ANSWER>>Only the current class and
sub classes (and sometimes also same-package classes) of this class will have
access to the field or method.


What happens if you do not specify the access for a field? - ANSWER>>It will set the
access to package


Can a sub-class also be a super-class? - ANSWER>>Yes, Java allows this


What is an abstract method? - ANSWER>>It is a method that is declared, but contains
no implementation

Información del documento

Subido en
7 de agosto de 2024
Número de páginas
12
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$14.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.
QueenElsa
4.9
(61)
Vendido
82
Seguidores
36
Artículos
1013
Última venta
4 meses 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