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

Summary Theory Exam Overview Object-Oriented Programming (OOP) (Now Introduction to Programming)

Beoordeling
-
Verkocht
-
Pagina's
20
Geüpload op
11-10-2024
Geschreven in
2021/2022

Theory Exam Overview (Notes + Exam Questions) Object-Oriented Programming (OOP) (Now Introduction to Programming) Year 1 (2021/2022) Computer Science and Engineering at TU Delft











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

Documentinformatie

Geüpload op
11 oktober 2024
Aantal pagina's
20
Geschreven in
2021/2022
Type
Samenvatting

Onderwerpen

Voorbeeld van de inhoud

NOTES + PRACTICE QUESTIONS FOR THEORY EXAM
OBJECT-ORIENTED PROGRAMMING CSE1100
CSE TU Delft - Lieke Sanders
→ Course is now called Introduction to Programming
→ Includes general notes + explained MC/open/programming questions for the theory exam
(so not the computer exam!)

Index
(Facts stolen from) MC and open questions 2
Primitive vs reference 2
Compilation vs runtime errors 2
Inheritance 2
Arrays 2
Array copies 3
Class design 3
Static 5
Quality 5
== operator 5
Logical operators 6
Switch case 6
Values and pointers 6
Parameter passing 7
Static vs dynamic types 7
Compilation 8
Polymorphism 8
Iteration or recursion 9
Threads 9
Deadlock 9
Cyclomatic complexity 10
Streams 10
Overriding vs overloading 10
Tests 11
Exception tests 12

Programming questions 14
Patterns 14
Control flow 15
Reverse String 16
Capitalize first letter 17
Inheritance 17
Reader 18
Writer 19
Full class 19

,(Facts stolen from) MC and open questions
Primitive vs reference
Primitive Reference

Can not be null Can be null

Store the actual values Store the addresses

int/double/boolean/char/short/float/long/byte object/String/array


Compilation vs runtime errors
Compilation error Runtime error

Will prevent the program from running Will prevent the program from executing

Syntax/semantics Exceptions noticed while running program

Like too many/missing { } + forgetting ; + Like division by 0 (ArithmeticException) +
using a value without declaration NullPointerException


Inheritance
- In Java all classes inherit from the Object class directly or
indirectly. The Object class is root of all classes.
- Multiple inheritance is not allowed in Java.
- A non-abstract child class must override an abstract
method inherited from its parent by defining a method with
the same signature.
- Child classes can override and overload methods defined
in their superclass(es).
- A non-abstract class can not contain abstract methods.

Arrays
- An array is an arrangement of consecutive memory
locations.
- Using an array can lead to an
ArrayIndexOutOfBoundsException.
- An array does not grow automatically when you add elements to it.
- If you pass an array as a parameter, the memory address of that array is copied
rather than the values that are stored in the array.

, Array copies




What will happen if we run the main method?
The program will print true

Class design
1
- There is a non-abstract class Vehicle.
- BMW is a carmaker brand.
- There is more than 1 carmaker brand.
- Every BMW is a Vehicle.
Which of the following design choices is most appropriate?

x You should create a class BMW that inherits from Vehicle.
✓ The Vehicle class should have an attribute indicating the brand.
x There should be a “1 to 1” relationship between Vehicle and BMW.
x There should be a “1 to n” relationship between Vehicle and BMW.
€6,76
Krijg toegang tot het volledige document:

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

Maak kennis met de verkoper
Seller avatar
liekesanders

Ook beschikbaar in voordeelbundel

Thumbnail
Voordeelbundel
Theory + Programming Overview Object-Oriented Programming (OOP) (Now Introduction to Programming)
-
2 2024
€ 9,85 Meer info

Maak kennis met de verkoper

Seller avatar
liekesanders Technische Universiteit Delft
Bekijk profiel
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
3
Lid sinds
1 jaar
Aantal volgers
0
Documenten
11
Laatst verkocht
6 maanden geleden

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

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