Bifalgorithm post · Computer science one · Encapsulation & Objects
How does encapsulation group and protect related data?
How does encapsulation group and protect related data? (Computer science one · Encapsulation & Objects) — "The solution is to encapsulate the pieces of data in…
Ideas in this flowchart
- Encapsulation organizes data and related operations into a logical entity.
- The logical entity is sometimes referred to as an object.
- Encapsulation groups pieces of data with the functions that operate on them.
- Encapsulation can protect data by controlling its visibility from code outside the object.
- An array is also a collection of data, but it differs from an object.
- An array usually contains pieces of similar data, such as integers or floating-point numbers.
- An object may collect dissimilar data that together form a larger entity.
- The difference resembles the distinction between rows and columns in a table.
- In student data, each row represents a record and each column represents a data field.
- An identification number may be modeled as a string because it can contain dashes and begin with zeros.