1/23
Looks like no tags are added yet.
definition of recursion
a method/ function that calls itself
definition of a class
a blueprint of the fields and methods of objects
definition of an object
an instance of a class with its own state
overriding vs overloading
overriding changes inherited behaviour, overloading means writing a method with the same name but different parameters
what is polymorphism?
different classes responding differently to the same method call
what is composition?
a class containing another class as a field
what is aggregation?
represents the whole part
what is big-O notation
a measure of algorithmic growth rate
what is an array?
a fixed-size indexed collection
what is a constructor
a method that initialises an object
what is encapsulation?
restricting access to class data
what is the purpose of a constructor?
to initialise a new object fields when created
what does a static method mean?
it belongs to itself
what does overriding a method allow a sub class to do?
provide its own version of a base class
what is the purpose of an interface?
to define a contract of methods a class must implement
what does the ‘continue’ keyword do inside a loop?
skips to next iteration
what is a UML association?
a relationship showing that two classes interact
what does keyword ‘return’ do inside a metod?
ends the method and optionally gives a value
abstract vs virtual methods?
abstract methods have no code and have to be overridden, virtual methods have implementation and the option to be overridden
base class vs sub-class
base class is the parent and the sub-class is the child that inherits from the parent
what is an iteration?
how many times a loop is repeated
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
inheriting from a class vs an interface
you can only inherit from one class but can inherit from multiple interfaces
stack vs heap memory
value types and method call data are stored in stack, reference types are stored in heap