3 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for ddanbe

Inheritance with generic types can sometimes be tricky. If you would inherit from a Stack<double>, no problem, but what if you want to keep it as generic as possible? Maybe it's a bad idea, but I wrote something like `class Stacker<T> : Stack<T>` and in Stacker I implemented some arithmetic …

Member Avatar for JOSheaIV
1
768
Member Avatar for Begginnerdev

Upon aiding a friend - I have decided to post the example used here. The following is a snippet that shows basic class inheritance. The source file as well as a test case can be found attached. You can test these classes with the following code: Dim cNew As New …

3
215
Member Avatar for majestic0110

I just wanted to demonstrate a quick point regarding Constructors & inheritance. Look at these two classes and think about what you might expect to see after the main method has run. Notice that ClassB is a subclass (inherits from) of ClassA. So, what do we expect the output to …

Member Avatar for masijade
3
578

The End.