Tag Archives: abstraction vs encapsulation

What is Encapsulation

By | November 17, 2017

What is Encapsulation? Abstraction Vs Encapsulation It’s wrapping of data members and functions into a single unit called as class. An encapsulated object is often called an abstract data type. Advantage: Encapsulation can protect your data from accidental corruption Example: Let’s take example of substring() function which returns the string based on the start index and… Read More »