📞 0339-0387701 (WhatsApp) Contact

« Back to Software Engineering (NCCIA)

What is encapsulation?

A. Grouping data and the methods that operate on it and restricting direct access ✅
B. Running two programs at the same time
C. Reusing code through inheritance
D. Dividing a program into many files

Correct Answer: A. Grouping data and the methods that operate on it and restricting direct access

Explanation

  • Encapsulation protects internal state behind an interface
  • It prevents uncontrolled external modification of data.