🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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:

  1. A.Encapsulation
  2. B.Abstraction
  3. C.Composition
  4. 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 →