🎙 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 1 of 10

Making a field private and allowing changes only through a method that validates input is:

Making a field private and allowing changes only through a method that validates input is:

  1. A.Encapsulation
  2. B.Inheritance
  3. C.Polymorphism
  4. D.Abstraction
Answer & explanation

Correct answer: Encapsulation

Protecting data behind controlled access is encapsulation.

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 →