Compx Exam prep

0.0(0)
Studied by 1 person
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/23

encourage image

There's no tags or description

Looks like no tags are added yet.

24 Terms

1
New cards

definition of recursion

a method/ function that calls itself

2
New cards

definition of a class

a blueprint of the fields and methods of objects

3
New cards

definition of an object

an instance of a class with its own state

4
New cards

overriding vs overloading

overriding changes inherited behaviour, overloading means writing a method with the same name but different parameters

5
New cards

what is polymorphism?

different classes responding differently to the same method call

6
New cards

what is composition?

a class containing another class as a field

7
New cards

what is aggregation?

represents the whole part

8
New cards

what is big-O notation

a measure of algorithmic growth rate

9
New cards

what is an array?

a fixed-size indexed collection

10
New cards

what is a constructor

a method that initialises an object

11
New cards

what is encapsulation?

restricting access to class data

12
New cards

what is the purpose of a constructor?

to initialise a new object fields when created

13
New cards

what does a static method mean?

it belongs to itself

14
New cards

what does overriding a method allow a sub class to do?

provide its own version of a base class

15
New cards

what is the purpose of an interface?

to define a contract of methods a class must implement

16
New cards

what does the ‘continue’ keyword do inside a loop?

skips to next iteration

17
New cards

what is a UML association?

a relationship showing that two classes interact

18
New cards

what does keyword ‘return’ do inside a metod?

ends the method and optionally gives a value

19
New cards

abstract vs virtual methods?

abstract methods have no code and have to be overridden, virtual methods have implementation and the option to be overridden

20
New cards

base class vs sub-class

base class is the parent and the sub-class is the child that inherits from the parent

21
New cards

what is an iteration?

how many times a loop is repeated

22
New cards

compile time error vs run time error

compile time errors are structural and found before a program runs, run time errors are found while the program runs

23
New cards

inheriting from a class vs an interface

you can only inherit from one class but can inherit from multiple interfaces

24
New cards

stack vs heap memory

value types and method call data are stored in stack, reference types are stored in heap