COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Information Hiding can also be termed as ____ ?
A
Inheritance
B
Encapsulation
C
Data Hiding
D
None of the above
Explanation: 

Detailed explanation-1: -By definition, encapsulation describes bundling data and methods that work on that data within one unit, like a class in Java. We often often use this concept to hide an object’s internal representation or state from the outside. This is called information hiding.

Detailed explanation-2: -While data hiding focuses on restricting data use in a program to assure data security, data encapsulation focuses on wrapping (or encapsulating) the complex data to present a simpler view to the user. In data hiding, the data has to be defined as private only. In data encapsulation, the data can be public or private.

Detailed explanation-3: -Steganography is the art and science of encoding hidden secret information in a way that no one, apart from the sender and intended recipient, suspects the existence of this information.

Detailed explanation-4: -Data hiding is used for attaining Encapsulation whereas Abstraction limits access to the internal details and show the essential features. Abstraction is achieved by using the abstract classes and interfaces. And Data Hiding is achieved by using private and protected access specifiers.

Detailed explanation-5: -Encapsulation may be considered to be the same as information hiding, but the term is often used to describe the practical implementation of information hiding, especially in object-oriented programming. Information hiding is the process of hiding the details of an object or function.

There is 1 question to complete.