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

Intro to Java Programming – 70 Exam Questions with Answers – Loops, Classes, Arrays – CS101

Document preview thumbnail
Vista previa 4 fuera de 66 páginas

This document provides a curated set of 70 multiple-choice questions with correct answers for the Intro to Java Programming (CS101) course, specifically aligned with the 2025 academic year. It is tailored for students enrolled in Computer Science, Software Engineering, and Information Technology programs, particularly in their first year or during introductory Java modules. The content targets key foundational topics in Java programming, including: Java syntax and programming structure Declaration and use of primitive data types Looping constructs: for, while, and do-while Conditional control structures such as if-else and switch Array declarations, initialization, and traversal String manipulation basics Class structure, object instantiation, and basic OOP concepts Java keywords, access modifiers, and method usage Basic error recognition (syntax and logic issues) Each question includes a clearly marked correct answer, making the document especially useful for: University exam prep and semester revisions Practice tests and lab evaluations Java foundation certification prep MCQ-based entrance assessments Instructor resource for quizzes or reviews This material is relevant for: CS101 students in Computer Science, Software Engineering, or IT tracks Introductory programming courses using Java High school or college students preparing for Java-related assessments Anyone learning Java for the first time seeking self-evaluation material Its structured and focused approach ensures that students reinforce core Java knowledge effectively in preparation for formal testing environments. Keywords: Java MCQ, Java loops, Java arrays, Java classes, Java syntax, Java exam prep, Java questions, Java OOP basics, Java methods, Java control structures, CS101 Java, Java programming fundamentals, Java practice test

Vista previa del contenido

Java 2025/2026 Exam Questions and
Answers | 100% Solved



If you overwrite clone(), which 3 rules must this method obey? - 🧠ANSWER

✔✔1) the new object should be new: memory address should differ


2) Both should be an object of the same class

3) Both should be in the same state:

a.clone().equals(a) == true


Why do we need to implement the Clonable interface? - 🧠ANSWER ✔✔At

runtime it would throw the CloneNotSupportedException if we don't

implement the Cloneable interface. A class implements the Cloneable

interface to indicate to the Object.clone() method that it is legal for that

method to make a field-for-field copy of instances of that class.

,What is a marker interface? - 🧠ANSWER ✔✔A Marker interface, has no

method.

Serializable, Clonable are marker interfaces.


How do you clone an object? - 🧠ANSWER ✔✔MyClone a = (MyClone)

c.clone()

- TypeCast is nessesary.

- handle CloneNotSupportedException

Why can Annotations replace marker interfaces? - 🧠ANSWER

✔✔Annotations can convey metadata about the class to its consumers

without creating a separate type for it. Annotations let you pass information

to classes that "consume" it.


What is Double-Checked Locking? - 🧠ANSWER ✔✔To reduce the

overhead of acquiring a lock by first testing the locking criterion without

actually acquiring the lock.


How do you make an object serializable? - 🧠ANSWER ✔✔The class must

implement the java.io.Serializable interface

,Java object serialization is performed using which classes? - 🧠ANSWER

✔✔Java object serialization (writing) is done with the ObjectOutputStream

and deserialization (reading) is done with the ObjectInputStream.


What is serialVersionUID? - 🧠ANSWER ✔✔In addition to implementing the

Serializable interface, a class intended for serialization should also contain

a private static final long variable named serialVersionUID.

The serialVersionUID variable is used by Java's object serialization API to

determine if a deserialized object was serialized (written) with the same

version of the class, as it is now attempting to deserialize it into.

If you make changes to the class that affect serialization, you should also

change its serialVersionUID value.


What is escape analysis? - 🧠ANSWER ✔✔escape analysis is a method for

determining the dynamic scope of pointers - where in the program a pointer

can be accessed.


What is the size of byte? - 🧠ANSWER ✔✔8 bits


What is the size of char? - 🧠ANSWER ✔✔16 bits


What is the size of short? - 🧠ANSWER ✔✔16 bits



3
COPYRIGHT©JOSHCLAY 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE. PRIVACY
STATEMENT. ALL RIGHTS RESERVED

, What is the size of int? - 🧠ANSWER ✔✔32 bits


what is the size of long? - 🧠ANSWER ✔✔64 bits


what is the size of float? - 🧠ANSWER ✔✔32 bits


what is the size of double? - 🧠ANSWER ✔✔64 bits


What is the range of byte - 🧠ANSWER ✔✔-128 to 127


What is the range of short? - 🧠ANSWER ✔✔-32,768 to 32,767


What is the range of int? - 🧠ANSWER ✔✔-2,1 billion to 2,1billion


How do you check if a number is even? - 🧠ANSWER ✔✔check if number

AND 1 is 0


How do you test if the n-th bit is set? - 🧠ANSWER ✔✔Shift n times to the

right and then AND


How can you set the n-th bit - 🧠ANSWER ✔✔Shift n times to the left and

OR


How can you unset the nth bit - 🧠ANSWER ✔✔Shift n times to the left and

invert, then AND

Información del documento

Subido en
29 de septiembre de 2025
Número de páginas
66
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$15.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.
JOSHCLAY
3.5
(96)
Vendido
457
Seguidores
15
Artículos
21462
Última venta
1 día 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