Question

In: Computer Science

Abstraction is a key part of object-oriented programming and the concepts apply particularly well to classes....

Abstraction is a key part of object-oriented programming and the concepts apply particularly well to classes. How would the same concepts apply to data structures and how we tend to define and think of ADTs?

Solutions

Expert Solution

In object-oriented programming, abstraction is one of three central principles (along with encapsulation and inheritance). Through the process of abstraction, a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency.Another important abstraction provided by a programming language is function. This abstraction allows programmers to group a set of instructions and give it a name. The named set of instructions may take one or more variables as input parameters, and return one or more values.Like all other abstractions, defining functions allow us to think at a higher conceptual level. By composing functions at increasingly higher level of abstractions, we can build programs with increasing level of complexity.Abstraction is selecting data from a larger pool to show only the relevant details to the object. It helps to reduce programming complexity and effort. In Java, abstraction is accomplished using Abstract classes and interfaces. It is one of the most important concepts of OOPs.A data abstraction is a mental model of what can be done to a collection of data. It deliberately excludes details of how to do it. We implement a data abstraction by. choosing an appropriate data structure - a specific construction of data, and. providing appropriate operations to manipulate that data.Data abstraction refers to providing only essential information to the outside world and hiding their background details, i.e., to represent the needed information in program without presenting the details.Abstract Data Type(ADT) is a data type, where only behavior is defined but not implementation. Opposite of ADT is Concrete Data Type (CDT), where it contains an implementation of ADT. Examples: Array, List, Map, Queue, Set, Stack, Table, Tree, and Vector are ADTs.Implementing an ADT means providing one procedure or function for each abstract operation. The ADT instances are represented by some concrete data structure that is manipulated by those procedures, according to the ADT's specifications.Usually there are many ways to implement the same ADT, using several different concrete data structures. Thus, for example, an abstract stack can be implemented by a linked list or by an array.


Related Solutions

Abstraction is a key part of object-oriented programming and the concepts apply particularly well to classes....
Abstraction is a key part of object-oriented programming and the concepts apply particularly well to classes. How would the same concepts apply to data structures and how we tend to define and think of ADTs?
What are the object oriented concepts and which all object oriented concepts are used in the...
What are the object oriented concepts and which all object oriented concepts are used in the given program? Consider the following code and explain how each of the object oriented concepts are applied in the given program. (CO1) class Vehicle { string brand; public: void honk(); void honk(int); }; void Vehicle::honk() { cout << "Tuut, tuut! \n" ; } void Vehicle::honk(int x) { for(int i=0;i<x;i++) cout << "Tuut, tuut! \n" ; } int main() { Vehicle V1; V1.honk(); V1.honk(3); }
Explain what classes and objects are in object - oriented programming. Give an example of each...
Explain what classes and objects are in object - oriented programming. Give an example of each and explain how they work together in a computer program.
i need a full explanation in details Object Oriented Programming Principles Principles Polymorphism Inheritence Encapsulation Abstraction...
i need a full explanation in details Object Oriented Programming Principles Principles Polymorphism Inheritence Encapsulation Abstraction Class Object Method Message Passing
Using the various Object Oriented Programming concepts and skills learnt in this course, design and develop...
Using the various Object Oriented Programming concepts and skills learnt in this course, design and develop a Java Application to compute an individual student’s GPA and store the records in a database. The application should have two components i.e. The student and the course components. The following should be the minimal operations on the course component: – Set course information – Print course information – Show credit hours – Show course number The following should be the minimal operations on...
What is different between procedural and object-oriented programming? Match each of the following OOP concepts with...
What is different between procedural and object-oriented programming? Match each of the following OOP concepts with its example/description. Question 2 options: 12345678 Providing a way for an entity to behave in several ways OR providing multiple entities to be treated in a similar way 12345678 A key way of saving having to retype a lot of code for similar but different objects 12345678 The removal of non-essential information 12345678 Allowing which function to be called by an object to be...
C++In Object Oriented Programming, classes represent abstractionsof real things in our programs. We must...
C++In Object Oriented Programming, classes represent abstractions of real things in our programs. We must quickly learn how to define classes and develop skills in identifying appropriate properties and behaviors for our class. To this end, pick an item that you work with daily and turn it into a class definition. The class must have at least three properties/data fields and three functions/behaviors (constructors and get/set functions don’t count). Do not pick examples from the textbook and do not redefine...
In Object Oriented Programming, classes represent abstractionsof real things in our programs. We must quickly...
In Object Oriented Programming, classes represent abstractions of real things in our programs. We must quickly learn how to define classes and develop skills in identifying appropriate properties and behaviors for our class. To this end, pick an item that you work with daily and turn it into a class definition. The class must have at least three properties/data fields and three functions/behaviors (constructors and get/set functions don’t count). Do not pick examples from the textbook and do not redefine...
-What is object-oriented programming? -What is a class? -What is an object? -A contractor uses a...
-What is object-oriented programming? -What is a class? -What is an object? -A contractor uses a blueprint to build a set of identical houses. Are classes analogous to the blueprint or the houses? Explain. -What is a class diagram? How is it used in object-oriented programming? -What is an attribute in OOP? What is a data member? -What is a method in OOP? What is a member function? -What is the difference between private members and public members of a...
Briefly explain the terms used in object-oriented programming with examples.
Briefly explain the terms used in object-oriented programming with examples.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT