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
-2
votes
2 answers

Is that true about "Encapsulation" and "Abstraction "?

Encapsulation is just hiding the internal mechanism of the program Abstraction is providing a public interface from encapsulated program is that true ??
Adham shafik
  • 1,044
  • 1
  • 13
  • 16
-2
votes
1 answer

Abstracting Specific csv Column Information in C++

I am pulling in data from a .csv file. I want only data from column E, but this is conditional on what is specified via column A. That is, I want to pull the double (type) values given that column A says "USD Libor/Swap". As of right now it just…
user5619709
  • 53
  • 2
  • 11
-2
votes
1 answer

Behavioral Abstraction

I am trying to understand behavioral abstraction, particularly in relation to the concept of object oriented programming. My current understanding is that it is a combination of data and procedural abstraction, which are combined to create class…
Vladamir
  • 247
  • 1
  • 3
  • 11
-2
votes
1 answer

Common Errors on my Program(Polymorphism/Override/Inheritance)

Hi I know you can easily find the error here, and i need help to fix this out I'm very tired to find what's wrong with my code,I'm trying to fix it out but it becomes complicate when im trying to change something here's my currently code: package…
-2
votes
1 answer

Java abstraction and interface

I am looking for a solution to a problem in Java. Hope team can help me. Consider following classes: Class A{ //constructor Object obj; public A(Object obj){ this.obj = obj; } public void ma1(){ system.out.println("In ma1"); …
-2
votes
1 answer

with initializing arrays from methods

So I have an abstract class, Player. Then I have classes, thePlayer, and Dealer, which extend Player. I have a method initHand, which is an array of BlackJackCard. in thePlayer and Dealer I call this method to assign to my own array to use. However,…
-3
votes
3 answers

What is significance of abstraction from an end user perspective

Recently I was asked a question in an interview that even if we are using abstract classes or interfaces in our code the end-user, who is most probably be clicking buttons on UI, won't be exposed to inner functionality. So even if we don't implement…
thealchemist
  • 421
  • 4
  • 12
-3
votes
1 answer

Can anyone point me to a good article on "abstracting HTML"?

I'm currently working on a legacy eCommerce system front-end that has alot of duplicate HTML code. I'm trying to find a way to abstract out the complexity almost as you would when moving the similarities between similar classes into a shared…
leeand00
  • 25,510
  • 39
  • 140
  • 297
-3
votes
1 answer

Confusion regarding having inheritance or not in my design

I have requirement like this that Driver and Mechanic can Start,ApplyBrakes,ChangeGear and Stop the Car. I also have 2 additional functionalities that is Mechanic is the only one who can ChangeOil and AdjustBrakes and Driver should not be able to do…
I Love Stackoverflow
  • 6,738
  • 20
  • 97
  • 216
-3
votes
2 answers

Why is this class better suited to be abstract instead of concrete?

Why is this Student class (a class which creates new student objects and assigns them unique ID's) better suited to be an abstract class rather than a concrete class? Each student object created is assigned it's own unique ID right, so why not just…
-3
votes
1 answer

How to properly use interfaces and data abstraction together in C++?

I'm fairly confident in C and Java and just started using C++, still getting used to the basics about best practices including data abstraction (which, as far as I understand, means proper header usage). I'd like to make a project that solves…
SakoDaemon
  • 973
  • 1
  • 6
  • 21
-3
votes
2 answers

Abstraction patterns in go

I have two interfaces. They are almost the same, the only difference is the Set method: type Cache1 interface { Set(key, value interface{}, ttl time.Duration) bool } type Cache2 interface { Set(key, value interface{}) bool } Any idea how…
Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192
-3
votes
2 answers

Reasons to use generic List over List of object

I know two reason to use generic List over List of objects. To restrict what type of objects can be inserted into the List List stringObjects = Arrays.asList("a",new Integer(5)); List genericStrings = Arrays.asList("a",new…
Borislav Stoilov
  • 3,247
  • 2
  • 21
  • 46
-3
votes
1 answer

How to return child class object intead of base class object

abstract class B { } public abstract class A { public abstract B createBInstance(); } public class C extends A { @Override public D createBInstance() { return new D; } } where public class D extends B { } This give a compiler…
Malinda
  • 336
  • 2
  • 12
-3
votes
1 answer

How to create an abstract class in objective c?

Is abstraction possible in objective c, if yes then how? If no, then how is objective c fulfilling this oops concept?
saurabh
  • 259
  • 1
  • 3
  • 11
1 2 3
74
75