100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

CS 151 FINAL EXAM QUESTIONS AND ANSWERS. VERIFIED 2025/2026.

Puntuación
-
Vendido
-
Páginas
35
Grado
A+
Subido en
07-12-2025
Escrito en
2025/2026

CS 151 FINAL EXAM QUESTIONS AND ANSWERS. VERIFIED 2025/2026.

Institución
CS 151
Grado
CS 151











Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
CS 151
Grado
CS 151

Información del documento

Subido en
7 de diciembre de 2025
Número de páginas
35
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

CS 151 FINAL EXAM QUESTIONS AND
ANSWERS. VERIFIED 2025/2026.




The idea behind object-oriented programming is to structure a program around the real-world
concept of an object. Which of the following are the advantages of that approach?



A. It can make the program easier for humans to think about.



B. It usually makes the program run faster.



C. It can help with debugging. - ANS A, C



Which of the following statements is true?



A. An object can be used to produce multiple classes.



B. A class can be used to produce multiple objects - ANS B



Where are member variables declared?



A. Inside a class definition but outside the definition of any method in the class.

1 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.

,B. Inside any method within a class.



C. Inside every method within a class. - ANS A



When is it OK to have an overloaded method (i.e., method with the same name as another
method) that has a different return type?



A. Always



B. Never



C. Only when the parameter list is also different - ANS C



Which of the following is true about a class's constructor?



A. A constructor is variable in a class that can be used to reference the objects



B. A constructor is a special method used to invoke other methods in the same class.



C. The constructor is a special method with the same name as the class and it's used to
instantiate objects from that class - ANS C



True or false: In software, objects come into existence ONLY when an application is running and
they do all of the work in the application. - ANS True




2 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.

,True or false: An object is an instance of a class. Just like how a house or a building is an instance
of some blueprint that was designed by some architect. - ANS True



True or false: A class is a specification or blueprint or a design that contains details about how
an object will be in our application. - ANS True



What is the result of running the code?

(Hint: draw a memory model)



public class MyClass {

private int a;

public double b;

public MyClass(int first, double second)

{

this.a = first;

this.b = second;

}

public static void main(String[] args)

{

MyClass c1 = new MyClass(10, 20.5);

MyClass c2 = new MyClass(10, 31.5);

c2 = c1;

c1.a = 2;

System.out.println(c2.a);

}

} - ANS 2


3 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.

, What is the output from running this code?



public class MyClass

{

private int a;

public double b;

public MyClass(int first, double second)

{

this.a = first;

this.b = second;

}

public static void incrementBoth(MyClass c1) {

c1.a = c1.a + 1;

c1.b = c1.b + 1.0;

}

public static void incrementA(int first)

{

first = first + 1;

}

public static void incrementB(double second)

{

second = second + 1.0;

}

public static void main(String[] args)

{

4 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.

Conoce al vendedor

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.
Brainbarter Kaplan University
Ver perfil
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
325
Miembro desde
2 año
Número de seguidores
153
Documentos
22254
Última venta
5 días hace
A+ STUDY MATERIALS.

We offer a wide range of high-quality study materials, including study guides practice exams and flashcards. WELCOME.

3.5

54 reseñas

5
21
4
8
3
12
2
4
1
9

Recientemente visto por ti

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