What are the levels of abstraction in computer design?
Physical level: The lowest level of abstraction describes how a system actually stores data. The physical level describes complex low-level data structures in detail. Logical level: The next higher level of abstraction describes what data the database stores, and what relationships exist among those data.
What does it mean that a computer has many levels of abstraction?
The amount of complexity by which a system is viewed or programmed. The higher the level, the less detail. The lower the level, the more detail. The highest level of abstraction is the entire system.
Is a transistor high or low-level abstraction?
One example of a low-level hardware abstraction is a transistor. Transistors are devices that control the movement of electrons (and thus electricity) by starting/stopping the current or by controlling the amount of the current.
Which representation is at the lowest level of abstraction?
binary
What is abstraction with example?
Abstraction means displaying only essential information and hiding the details. Data abstraction refers to providing only essential information about the data to the outside world, hiding the background details or implementation. Consider a real life example of a man driving a car. This is what abstraction is.
What are the types of abstraction?
There are two types of abstraction.
- Data Abstraction.
- Process Abstraction.
Why is abstraction needed?
Abstraction is one of the key concepts of object-oriented programming (OOP) languages. Its main goal is to handle complexity by hiding unnecessary details from the user.
What is abstraction and encapsulation give real life example?
Encapsulation is hiding information. Abstraction is hiding the functionality details. By encapsulation, Car class can have complete control over how the data variables within car class can be modified. Any concrete entity that has some behavior is example of Encapsulation.
What is the difference between encapsulation and data abstraction?
Abstraction is the method of hiding the unwanted information. Whereas encapsulation is a method to hide the data in a single entity or unit along with a method to protect information from outside.
What is data hiding and data encapsulation?
Data hiding and encapsulation both are the important concept of object oriented programming. Encapsulation means wrapping the implementation of data member and methods inside a class. Data Hiding means protecting the members of a class from an illegal or unauthorized access.
Why abstraction is more powerful than encapsulation?
Abstraction solves problem at design level while Encapsulation solves problem at implementation level. Abstraction hides the irrelevant details found in the code whereas Encapsulation helps developers to organize the entire code easily.
Which access specifier is most secure during inheritance?
6. Which access specifier is/are most secure during inheritance? Explanation: The private members are most secure in inheritance. The default members can still be in inherited in special cases, but the private members can’t be accessed in any case.
What happens if a user forgets to define a constructor inside a class?
7. What happens if a user forgets to define a constructor inside a class? Explanation: The C++ compiler always provides a default constructor if one forgets to define a constructor inside a class.
What are access specifiers in oops?
Access specifiers define how the members (attributes and methods) of a class can be accessed. private – members cannot be accessed (or viewed) from outside the class. protected – members cannot be accessed from outside the class, however, they can be accessed in inherited classes.
What is the difference between protected and private access specifiers in inheritance?
The class members declared as private can be accessed only by the functions inside the class. The class member declared as Protected are inaccessible outside the class but they can be accessed by any subclass(derived class) of that class.
What is the difference between protected and private?
Private members are accessible within the same class in which they are declared. Protected members are accessible within the same class and within the derived/sub/child class. Private members can also be accessed through the friend function. Protected members cannot be accessed through the friend function.
Why protected access specifier is used?
The protected keyword specifies access to class members in the member-list up to the next access specifier ( public or private ) or the end of the class definition. Class members declared as protected can be used only by the following: Member functions of the class that originally declared these members.
Can private members of a base class are inheritable?
Are Private members of base class always inherited in derived class in C++? It should be 1 byte (which is the size of an empty class in C++) because private members are never inherited.
How do you inherit private members in C++?
The private members of a class can be inherited but cannot be accessed directly by its derived classes. They can be accessed using public or protected methods of the base class. The inheritance mode specifies how the protected and public data members are accessible by the derived classes.
What is virtual base class in C++?
Virtual base classes are used in virtual inheritance in a way of preventing multiple “instances” of a given class appearing in an inheritance hierarchy when using multiple inheritances.
What does derived class does not inherit from the base class?
Not all members of a base class are inherited by derived classes. The following members are not inherited: Static constructors, which initialize the static data of a class. Instance constructors, which you call to create a new instance of the class.
What does a derived class automatically inherit from the base class?
parent(). child(). What does a derived class automatically inherit from the base class? When you define a derived class, you give only the added instance variables and the added methods as well as all the methods from the base class.
What happens if the base and derived class?
What happens if the base and derived class contains definition of a function with same prototype? Compiler reports an error on compilation. Only base class function will get called irrespective of object. Base class object will call base class function and derived class object will call derived class function.
What is the keyword used to declare a file pointer?
2) What is the keyword used to declare a C file pointer.? Explanation: FILE *fp; 3) What is a C FILE data type.?
Which of the following is correct way of declaring the float pointer variable?
Discussion Forum
| Que. | Which of the following is the correct way of declaring a float pointer: |
|---|---|
| b. | float *ptr; |
| c. | *float ptr; |
| d. | None of the above |
| Answer:float *ptr; |