tagged [abstract-class]
Is it possible to make abstract classes?
Is it possible to make abstract classes? How can I make a class or method abstract in Python? I tried redefining `__new__()` like so: But now, if I create a class `G` that inherits from `F` like so: T...
- Modified
- 25 Jan at 04:16
When to use: Java 8+ interface default method, vs. abstract method
When to use: Java 8+ interface default method, vs. abstract method Java 8 allows for default implementation of methods in interfaces called [Default Methods](http://java.dzone.com/articles/introductio...
- Modified
- 12 May at 18:39
What is the difference between an interface with default implementation and abstract class?
What is the difference between an interface with default implementation and abstract class? C# 8.0 has introduced a new language feature – default implementations of interface members. The new default...
- Modified
- 26 Sep at 13:7
What's the difference between an abstract class and an interface?
What's the difference between an abstract class and an interface? Suppose we have two methods `M1()` and `M2()` in an interface. An abstract class also has just the same two abstract methods. If any c...
- Modified
- 2 Mar at 21:12
Mocking abstract class that has constructor dependencies (with Moq)
Mocking abstract class that has constructor dependencies (with Moq) I have an abstract class whose constructor needs collection argument. How can I mock my class to test it ? ``` public abstract class...
- Modified
- 22 Feb at 08:32
internal abstract methods. Why would anyone have them?
internal abstract methods. Why would anyone have them? I was doing some code review today and came across an old code written by some developer. It goes something like this If you have a derived class...
- Modified
- 25 May at 03:8
Relevance of 'public' constructor in abstract class
Relevance of 'public' constructor in abstract class Is there any relevance of a 'public' constructor in an abstract class? I can not think of any possible way to use it, in that case shouldn't it be t...
- Modified
- 30 Apr at 05:53
C# abstract Dispose method
C# abstract Dispose method I have an abstract class that implements IDisposable, like so: In Visual Studio 2008 Team System, I ran Code Analysis on my project and one of the warnings that came up was ...
- Modified
- 18 Feb at 15:21
Why an abstract class implementing an interface can miss the declaration/implementation of one of the interface's methods?
Why an abstract class implementing an interface can miss the declaration/implementation of one of the interface's methods? A curious thing happens in Java when you use an abstract class to implement a...
- Modified
- 30 Apr at 04:13
Internal abstract class: how to hide usage outside assembly?
Internal abstract class: how to hide usage outside assembly? I have a common assembly/project that has an abstract base class, then several derived classes that I want to make public to other assembli...
- Modified
- 19 Feb at 16:45
C#: Creating an instance of an abstract class without defining new class
C#: Creating an instance of an abstract class without defining new class I know it can be done in Java, as I have used this technique quite extensively in the past. An example in Java would be shown b...
- Modified
- 9 Feb at 09:56
Declaring abstract method in TypeScript
Declaring abstract method in TypeScript I am trying to figure out how to correctly define abstract methods in TypeScript: Using the original inheritance example: ``` class Animal { constructor(publi...
- Modified
- 22 Sep at 08:31
Is there a syntax for creating an anonymous subclass in C#?
Is there a syntax for creating an anonymous subclass in C#? Can I create instance of class in C#/.net like in Java ? Additional Info I think a lot of us does not understand what do I mean? So, In java...
- Modified
- 23 Apr at 16:21
How to unit test abstract classes: extend with stubs?
How to unit test abstract classes: extend with stubs? I was wondering how to unit test abstract classes, and classes that extend abstract classes. Should I test the abstract class by extending it, stu...
- Modified
- 21 Dec at 06:48
When do I have to use interfaces instead of abstract classes?
When do I have to use interfaces instead of abstract classes? I was wondering when I should use interfaces. Lets think about the following: and : I can easily implement both of them, they have the sam...
- Modified
- 6 Aug at 09:24
How to use moq to test a concrete method in an abstract class?
How to use moq to test a concrete method in an abstract class? In the past when I wanted to mock an abstract class I'd simply create a mocked class in code that extended the abstract class, then used ...
- Modified
- 5 Mar at 18:54
Can I define an abstract class for all derived Singletons in this way?
Can I define an abstract class for all derived Singletons in this way? This is my abstract class which must be derived each time I want to make a [Singleton](http://msdn.microsoft.com/en-us/library/ff...
- Modified
- 19 Nov at 18:8
Abstract UserControl inheritance in Visual Studio designer
Abstract UserControl inheritance in Visual Studio designer I dropped a DetailControl in a form. It renders correctly at runtime, but the designer displays an error and
- Modified
- 9 Aug at 19:23
C# - How to make a method only visible to classes that inherit the base class of the method
C# - How to make a method only visible to classes that inherit the base class of the method I have a base class that is marked as abstract. Is it possible to make a method in that base class only visi...
- Modified
- 16 Nov at 17:0
implementing a cast operator in a generic abstract class
implementing a cast operator in a generic abstract class I'm trying to be lazy and implement the cast operators in the abstract base class rather than in each of the derived concrete classes. I've man...
- Modified
- 10 May at 12:27
Get class by string value
Get class by string value I have an abstract class with a few derived class ``` public abstract class MyObject { public string name { get; set; } public bool IsObject(string pattern); ... } publ...
- Modified
- 19 Dec at 12:7
Can't instantiate abstract class with abstract methods
Can't instantiate abstract class with abstract methods I'm working on a kind of lib, and I'm getting an error. - [Here](https://github.com/josuebrunel/yahoo-fantasy-sport/blob/master/fantasy_sport/ros...
- Modified
- 22 Dec at 09:34
write c# implementation of abstract class inline?
write c# implementation of abstract class inline? I found a great example of code written in java for the use of a timer / timertask classes... I am currently turning this into c# for a 'Mono for Andr...
- Modified
- 10 Jun at 15:29
Inheritance of Custom Attributes on Abstract Properties
Inheritance of Custom Attributes on Abstract Properties I've got a custom attribute that I want to apply to my base abstract class so that I can skip elements that don't need to be viewed by the user ...
- Modified
- 25 Mar at 23:0
Pure virtual methods in C#?
Pure virtual methods in C#? I've been told to make my class abstract: And to make a method called move virtual ``` public virtual void Move() { //use the property to ensure that there is a v...
- Modified
- 28 Jun at 23:52