Questions tagged [abstraction]

Abstraction is a computer science concept in which an implementation is separated from its interface.

Abstraction is a computer science concept in which an implementation is separated from its interface. Abstraction allows an implementation to be modified without changing the interface, so that other code which relies on this interface does not have to be modified.

For instance, a function prototype in C would be considered the function's interface, and its definition is considered the implementation. The function definition can change (for instance, to improve performance or fix a bug), but as long as the function signature (as specified by the prototype) is the same, any code calling the function can remain the same.

1121 questions
-1
votes
3 answers

How this program implements the concept of abstraction?

Today,i was searching about abstraction and i got this example....how this program implements the concept of abstraction and please also elaborate what is abstraction in c++ #include using namespace std; class Adder{ public: //…
Vik Jamwal
  • 1
  • 1
  • 1
-1
votes
2 answers

Building CMS on top of Framework (Theory Only)

Im looking for answers detailing theoretical approaches, so don't worry about any technical specifics. I am researching concepts to build a simple CMS and one thing I cannot decide is whether to use pure PHP with various libraries, or to build it on…
Flosculus
  • 6,880
  • 3
  • 18
  • 42
-2
votes
1 answer

How could we experience the power of object oriented programming in procedural language?

As we know that the Object oriented programming language has lots of benefit.But in same implementation procedural language like C do not have any alternative like realtime applications. So can we combine the power of two to create a great…
-2
votes
1 answer

Is interface the right way to go?

I am making a Bicycle interface acting as a blueprint for all types of bikes. I have multiple classes that implements the Bicycle interface, classes such as BMX, MountainBike, RoadBike, MotorBike...etc. Now, I understand that interfaces are one way…
tarrzaann
  • 1
  • 2
-2
votes
2 answers

is not abstract and does not override abstract method

I have homework and when I run it it give me this message (is not abstract and does not override abstract method) and I use an interface and should run ok interface Employee1212 { int retirementAge = 60; double generateSalary(); double…
-2
votes
3 answers

How to refactor two classes doing the same thing except one method to make them more OOP-friendly?

i have problem about design a module of my project. Lets say, you have two classes which both of them almost doing the same thing. You can think like DeviceManager. Both of them connect/disconnect/parse exactly the same way. After parse the message…
Hasan Durukan
  • 83
  • 1
  • 7
-2
votes
1 answer

Problem building a generic inherited class in C#

I wrote the following classes and I don't know why the line: return new PersonEncrypterDecrypter() which is in the class EncrypterDecrypterBuilder does not work. It is said that that casting is not allowed but I do not see any reason that it…
chinakid
  • 3
  • 3
-2
votes
1 answer

What is abstraction in C#?

I am confused in between many definitions of abstraction. can any one tell me what is abstraction and how can we achieve it ?
-2
votes
1 answer

Implement different concretions to an abstract class that implements a generic service

I have a generic interface and one generic class with generic methods to query the database. public interface IRepositoryBase { IEnumerable GetAll(Func, IncludableQueryable> include =…
asd123ea
  • 121
  • 2
  • 13
-2
votes
1 answer

Abstract method do not abstract class

Somehow, I am getting an JNI error for the code below when using an abstract. This shouldn't happen as I think I have wrote it correct. Can please someone have a look. package Abstraction; public class Abstraction1_After { public static void…
-2
votes
1 answer

What is the use of Abstraction?

I'm struggling to understand the overall use of Abstraction in Java. I have been working off an example in this link: https://javatutorial.net/java-abstraction-example I understand the implementation of it but I don't understand why its even…
-2
votes
1 answer

What is the exact difference between abstraction and encapsulation in C++

C++: Difference between abstraction and encapsulation in c++ I have seen some answers on this topic but I want to know the difference by an example which relates to the theoretical concept of these topics.
Sagar Chauhan
  • 23
  • 1
  • 3
-2
votes
1 answer

C++ Iterating with for loop and calling a function within it

So I've been following some tutorials on Udemy for C++ and so far it's been incredibly informative and clear however I'm a little stumped by how a for function is calling another function. So my first function is; EDIT I've included use namespace…
Munerz
  • 1,052
  • 1
  • 13
  • 26
-2
votes
1 answer

Why Use Abstraction?

I was recently told that I should use abstraction more in my code. I am fairly unfamiliar with the matter, and in research I have found a lot about abstract classes but I am referring more to the "information hiding" portion, not the function in the…
Ian Ryan
  • 3
  • 4
-2
votes
4 answers

abstraction can be done without inheritance? java

Is abstraction possible without inheritance? This is my code abstract class whatever { abstract void disp1(); abstract void disp2(); abstract void disp3(); } class what { void disp1() { System.out.println("This is…
Asma Rahim Ali Jafri
  • 1,173
  • 2
  • 15
  • 22