← Quiz: Encapsulation and Abstraction: all 10 questions
Quiz: Encapsulation and Abstraction · Question 2 of 10
An interface PaymentMethod with a method pay(), used without knowing how each payment works, is an example of:
An interface PaymentMethod with a method pay(), used without knowing how each payment works, is an example of:
- A.Encapsulation
- B.Abstraction
- C.Composition
- D.Overloading
Answer & explanation
Correct answer: Abstraction
Users see what (pay) and not how — abstraction.
Can you get the rest right without peeking?
Take the timed Quiz: Encapsulation and Abstraction quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →