100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Tentamen (uitwerkingen)

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

Beoordeling
-
Verkocht
-
Pagina's
35
Cijfer
A+
Geüpload op
07-12-2025
Geschreven in
2025/2026

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

Instelling
CS 151
Vak
CS 151











Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
CS 151
Vak
CS 151

Documentinformatie

Geüpload op
7 december 2025
Aantal pagina's
35
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

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.
€11,79
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten


Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
Brainbarter Kaplan University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
325
Lid sinds
2 jaar
Aantal volgers
153
Documenten
22254
Laatst verkocht
5 dagen geleden
A+ STUDY MATERIALS.

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

3,5

54 beoordelingen

5
21
4
8
3
12
2
4
1
9

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen