Click here to Skip to main content
15,885,757 members
Everything / Abstract

Abstract

abstract

Great Reads

by Prajnan Das
Levenshtein distance can be an effective tool to identify code similarity (or duplicate code)
by Eric Payne
The simplest, fastest way to send a file from your computer using Bluetooth!
by Ehsan Sajjad
Repository pattern implementation in ADO.NET using Generics
by SarveshShukla
This article describes the concept of an abstract class in .NET.

Latest Articles

by Greg Utas
Registering and efficiently accessing polymorphic objects
by Dave “DWC” Curry
How to wire up drag+drop events through multiple objects.
by Marco-Hans Van Der Willik
There are a surprising number of variations on poker rules, making poker an excellent candidate for a SOLID Project, a project illustrating SOLID Principles and related Patterns & Practices.
by Arun Chandrasekhara Pillai
Generic JqGrid implementation in MVC with custom filtering and dynamic sorting

All Articles

Sort by Score

Abstract 

25 Jan 2016 by Prajnan Das
Levenshtein distance can be an effective tool to identify code similarity (or duplicate code)
22 Jan 2015 by BillWoodruff
I think you are struggling, as many newcomers to C# and OOP do, with trying map big-picture concepts/outcomes of implementing what you might call "general OOP philosophy" to actual C# code objects you program with.In my experience students often start C# with a general sense that OOP is...
13 Jun 2017 by Kornfeld Eliyahu Peter
Reading the error's documentation can be good idea sometimes... MSDN[^]: A class is required to implement all the abstract members in the base class, unless the class is also abstract. And if you ask yourself why... Abstract methods has no implementation by definition, however, now you created...
26 Jul 2015 by Sergey Alexandrovich Kryukov
First of all, the rule to have all abstract members overridden any any non-abstract class is not just about direct derived class, this is about all the derived classes. But you are right: once a member is implemented and made non-abstract, you can inherit it in next level of hierarchy instead of...
30 Jul 2019 by OriginalGriff
When you create an object the system always calls the base constructor (if it exists) before any derived constructors, so that the base object is fully constructed and read for use before any add-on code tries to use it. Think of it like this: if the base class was not constructed first, then...
4 Jul 2020 by Rick York
You are overcomplicating the base class definition. Try this : using UCHAR = unsigned char; using VUCHAR = std::vector; template class ObjectTransformerBase { public: virtual T ToStructure( VUCHAR & bytes ) = 0; ...
21 Jan 2015 by Zoltán Zörgő
Ok, you were not quite efficient in googling :)Encapsulation[^] is quite what you have drafted: hiding from the class "user" what's not his concern. If I implement a class that represents a polynom, don't let the user uf my class mess around with the array storing the coefficeints. And so...
25 Aug 2015 by OriginalGriff
First off, an interface isn't a class - it can't contain any implementation at all.An interface is a contract - "You agree to do this, and I'll let you in the club". This is nothing like a class, which says "I provide this, you can build upon it".Can an abstract class include an interface...
6 Oct 2015 by Tomas Takac
What I was getting at in my comment was you should use generics. Let's say we have following classes for shapes:public abstract class ShapeBase{ public abstract void Area();}public class Circle : ShapeBase{ public override void Area() { ... }}public class Triangle :...
7 Oct 2015 by sreeyush sudhakaran
Hi, Your question was breaking my heads , here I tried out to find a generic area calculator all you need is to pass co-ordinates and number of sides for your shape ( note in case of circle sides is 1)I used polygon generic area calculation:Refer here :...
2 Jun 2016 by Eric Payne
The simplest, fastest way to send a file from your computer using Bluetooth!
22 Sep 2016 by Robert Zuckerstätter
Currently I'm working on improvements of an existing project (it's quite big) concerning the administration of screens (about 250 screens for data input, setup and presentation of results). I decided to create a abstract base class which forces the derived screens to implement some basic...
5 Sep 2017 by Dave Kreskowiak
No, ASP.NET Zero is a paid solution and with that comes support for it, from the people you got it from. This is where you go to get support on it.[^]
15 Dec 2021 by OriginalGriff
To be honest, I'm not going to go into details because that would mean a close inspection of that code, and what I can see from a cursory glance is that it's ... pretty poor quality. It's pretty much monolithic, it's full of duplicated code and...
16 Dec 2021 by Greg Utas
Once you're finished converting this code to classes, you should have learned that you should design that way from the beginning. Rewriting the code later is a lot of work and is prone to error as you cut and paste fragments into various classes,...
12 Mar 2014 by Member 10664585
I am implementing Priority QUE as a doubly linked list. My structs:typedef int kintyr;typedef struct qElem { struct qElem *prv; kintyr *dat; int *priority;}qElem;typedef struct que { qElem *fr,*bk; int cnt; ...
27 Nov 2014 by battech
I have 2 dll's . 1)AbInterface.dll which has interface "InterfaceStart" and a method start() inside the interface . There are many classes too inside this dll.2)AbClass.dll which has a class "AbClassStart" that implements "InterfaceStart" and does have a definition for Start() method in...
23 Feb 2015 by Member 11474312
I have written the code to Abstract Base class, How can i access the child class method (enviorment_trees) using another class? Is it possible? from abc import ABCMeta, abstractmethod class EnvironmentAsset(object): __metaclass__ = ABCMeta ...
1 Mar 2015 by Pushkar Prabhu
Abstraction is "To represent the essential feature without representing the background details." But how I can achieve this using abstract class? Or is there no relation in abstract class and Abstraction?
2 Mar 2015 by BillWoodruff
"Abstract," can be both noun, adjective, and verb, in English; in general OOP context we can say that 'Abstract Classes or Methods express virtual (or meta-) information, information which may be used (is required to be used) by other Classes, or Methods that inherit from them."Abstraction"...
26 Jul 2015 by Bollinez
Hello I am not completely new to c#, but I still have some problems with overriding methods and properties. Well I would like to know how you override them correctly. Let's look at this example:public abstract class BaseClass { private string description; public virtual string...
25 Aug 2015 by seyed mahmud shahrokni
Can an abstract class inherits from an interface class ?I have 8 classes in my programme.Taxi,Subway and Buss inherit from abstract public transportation.and also Taxi and Buss inherit from vehicle which is an interface class.mid-buss and large-buss inherit from buss and limo inherits from...
26 Oct 2015 by Member 12086907
sdfvdvs wfws wefrws wserf we w rwser rfwserf werfesfr
18 Nov 2015 by Oliver S. Neven
You have written all of your code inside the of the entrypoint method (public static main) as Sergey pointed out. This is generally a really bad way of doing it, especially in a object oriented programming language (aka OOP) like Java. An OOP language is a language where you can sort your code...
31 Mar 2016 by Richard MacCutchan
It is Impossible to answer such a question. The only way to become expert at anything is to work hard at it. Study, practice and practice.
22 Sep 2016 by OriginalGriff
That's a problem I've been complaining about since VS2005!You can't directly display any control that is based on a derived class, but there is a kludge round it: Deriving a concrete class from an abstract UserControl[^]It's not ideal in any way, but it works.
13 Dec 2016 by Er. Dinesh Sharma
Hi Experts,While I reading some blog I read one approach that is used by someone in interface and abstract class but I am not clearly understand that Please help me to find out that.1)What are benefits of inheriting the interface in abstract class?when we go for this approach?Is it good...
13 Dec 2016 by CPallini
If the abstract classes merely reproduce the signature of the interface (as in your scenario) then it is nearly useless. Generally speaking, the abstract class does augment interface signature or provide some implementation. Such features make it useful.
13 Dec 2016 by F-ES Sitecore
I wouldn't do such a thing unless IService was already defined and used elsewhere for some other purpose. If you want to take an existing interface and make an abstract class implement it that is fine I guess. As mentioned already though, if the interface is defined solely for the purpose of...
26 Jul 2018 by Kornfeld Eliyahu Peter
It is extremely important to learn the syntxt of the language you are using!!! Java Inheritance[^]
29 Jul 2018 by OriginalGriff
Quote: I have just done a lot of typing and backspacing, inputting a bunch of different things to try to make it work. And there is your problem. Stop typing. No, seriously - stop typing. Start thinking instead. Look at the rules, and work out what they require you to do when you play. Then get...
8 Jul 2020 by KulaGGin
In my project, I have a base abstract class with an interface, which derived classes implement. These derived classes have generic functions that accept parameters of different types. I have written these generic functions in my derived classes...
4 Jul 2020 by KarstenK
If you do it such manner you need one real class somewhere in your hierarchy, which is the base class of all instance classes for the implementation. Best is, when this class has all interfaces and the all virtual functions. Use clear and...
8 Jul 2020 by KulaGGin
Here's a C# version of the behavior I'm trying to achieve: using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace baseAbstractTemplates.NET { ...
7 Nov 2020 by codebeginer501
i am required to provide a redesign and refactoring of the classes that provides maximum reusability, extensibility and eliminates as many dependencies as possible in the class Alpha. i am free to change any of the classes in any way i wish,...
7 Nov 2020 by Richard MacCutchan
See Trail: Learning the Java Language (The Java™ Tutorials)[^].
21 Aug 2022 by oronsultan
In C# v7.3 (not 8.0), I'm looking for a solution for the following desired design: Right now I'm not sure between implementation of an Interface or an Abstract class (at the moment this is not the subject of the discussion) but my desired goal is...
21 Aug 2022 by OriginalGriff
You do it by declaring a variable of the interface / abstract class type you need: the type defines which method is called: StorageAccount sa = new StorageAccount(); IFile saFile = sa; var res1 = saFile.Get("something"); IDirectory saDir = sa;...
20 Dec 2013 by SarveshShukla
This article describes the concept of an abstract class in .NET.
8 Feb 2017 by Arun Chandrasekhara Pillai
Generic JqGrid implementation in MVC with custom filtering and dynamic sorting
30 Mar 2017 by Marco-Hans Van Der Willik
There are a surprising number of variations on poker rules, making poker an excellent candidate for a SOLID Project, a project illustrating SOLID Principles and related Patterns & Practices.
11 Sep 2014 by iSahilSharma
This article is the first part of the series "Abstract Class & Interface: Two Villains of Every Interview" and explains the important key points of Abstract Class.
31 Mar 2014 by dorodnic
Step by Step Implementation of Abstract Factory Design Pattern in C++
26 Nov 2015 by _Ankit_Singh_
There are 4 fundamentals ideas of Object Oriented Programming. They have the wonderful terms – Abstraction, Polymorphism, Inheritance, Encapsulation. One way to remember these is the acronym APIE. Let’s dive in each of them one by one.
17 Dec 2015 by Matt McGuire
Time Bias using system ticks
12 Mar 2014 by nv3
You have defined the priority member as a pointer to int. You probably meant to define it just as an int. For that reason the comparison in if (q->fr == NULL || q->fr->priority>prrt ) fails. You are comparing the pointers (addresses) instead of the values. Either make priority an...
6 Oct 2015 by jahanpanahh
Hi All,Recently I faced a question where I was asked to design an application. This application will have N number of buttons which have shapes mentioned on it(or buttons will be in particular shape e.g. Circle,Triangle). When any shape button is clicked user will be asked for information to...
6 Jul 2020 by Greg Utas
Registering and efficiently accessing polymorphic objects
19 Mar 2015 by Yaseer Mumtaz
When to use Abstract Class in C#, Real Time Example
17 Dec 2013 by An@nd Rajan10
The choice of whether to design your functionality as an interface or an abstract class (a MustInherit class in Visual Basic) can sometimes be a difficult one. An abstract class is a class that cannot be instantiated, but must be inherited from. An abstract class may be fully implemented, but is...
6 Oct 2015 by sreeyush sudhakaran
The below is a simple implemtation without using Design PatternsI think the interviewer asked you about implementation of Observer PatternPlease refer here about Observer Pattern...
17 Dec 2013 by Abdur Rashid
When to use an Abstract Class and an Interface?
22 Dec 2013 by Abdur Rashid
For some odd reason, work allows me to handle phone screens and interviews. Each time I give an interview, I try to do three things. First I ask them about general programming questions. This might be OO questions. It might be methodology questions. It might be design pattern questions. Next I...
30 Jul 2018 by User 13897807
Testing! New to this site and want to see how it works! What I have tried: Giving this a try!
21 Jan 2015 by Safari137
I just spent a long while on Google trying to figure this out and want to make sure I have it right.Encapsulation is hiding data that another programmer of different classes should not be able to directly access.Abstraction is only making available the methods and features that are...
3 Sep 2017 by Sarah Mohammed77
I'm using Asp.Net zero app and I read the documentation for it when I trying to add migration for the class public class MyEdition : Edition { public virtual int Price { get; set; } } the migration not append and just be like this public partial class...
29 Jul 2018 by radhikay
lang="java">package Pack1; abstract class A { int i; public A(int i) { this.i=i; System.out.println(this.i); } } class B extends A() //Syntax error on token "extends",@ expected after this token { //Syntax error on token "{", delete this token public B(int a) //syntax error...
16 Dec 2021 by Gabriel Sharp
Here is the code for the project, I need to work at implementing inheritance for it. I would like to have some virtual functions and make it a class driven program which uses derived classes and has a base class. The derived clase should inherit...
26 Oct 2015 by Member 12086907
jajhsdfkahed ahdsahd iasdhoajdo asdoasjdiasj kadhahhsddoass
11 Nov 2015 by Member 12133028
So I've finished my code which gets employee information as input and it can sort based on what the user wants. But for part of the requirements, I have two use an abstract class "Employee" with two subclasses "TempEmployee" and "Permemployee". What of my code do I put under the abstract...
12 Apr 2017 by Dave “DWC” Curry
How to wire up drag+drop events through multiple objects.
13 Jun 2017 by khosro goudarzi
Hi I have a abstract class public abstract class Service { public abstract void DoWork(); } and sub classes are public class Updater : Service { } and public class Sweeper : Service { public string Path { get; ...
25 Oct 2017 by Member 13484972
ifndef CARGO_H #define CARGO_H #include "stdafx.h" #include #include #include #include using namespace std; template class LinkedList { private: struct ListNode { T value; struct ListNode *next; }; ListNode *head; public: ...
1 Aug 2019 by radhikay
abstract class Base { Base() { System.out.println("Base Constructor Called"); } abstract void fun(); } class Derived extends Base { Derived() { System.out.println("Derived Constructor Called"); } void fun() { System.out.println("Derived fun() called"); } } class Main { ...