Week 11 Flashcards
Jenis polymorphism?
- subtype polymorphism, runtime polymorphism
- parametric polymorphism, compile-time polymorphism
- ad-hoc polymorphism, overloading
perbedaan static dan dynamic binding?
static binding:
- early binding
- pengecekan tipe data variable terjadi saat compile time
dynamic binding:
- late binding
- run time evaluation
pure polymorphism pake jenis binding apa?
dynamic binding
parametric polymorphism pake jenis binding apa?
bisa static atau dynamic
overloading dan overriding pake jenis binding apa?
static binding
syntax pure virtual function? yang tidak memiliki implementasi. class dengan pure virtual function adalah abstract base class
virtual void function() = 0;
standar c++ pake static binding. supaya dynamic pake apa?
virtual keyword
overriding terjadi saat? perlu inheritance
sebuah function dalam base class punya nama, return type, dan parameter yang sama dan ditulis ulang dalam derived class
karakteristik subtype polymorphism?
- butuh inheritance
- static binding / early binding
- compile time
- overriding function
- different scope, different class
karakteristik parametric polymorphism?
- execute same code for any type
2. compile time
ad-hoc polymorphism?
- function with same name, act differently
- overloading function
- no inheritance
- static binding
- compile time
syarat urutan overloading?
- jumlah
- tipe
- urutan
2 jenis virtual function?
- pure virtual function
2. quasi virtual function
ad hoc polymorphism also called as?
overloading
overriding happen only in?
inheritance