my6solutions

asp .net, the social web & other distractions

 

Running Apps


PayPal - The safer, easier way to pay online!

Disclaimer

I am in no way affiliated with Microsoft or Google. I am just another developer trying to make a difference. All opinions and observations are usually my own.

Mimicking Java enumerations in C#

In java, enumerations are actually classes. Thus, the java enumeration will allow methods, fields and interfaces. In C#, an enum is an enum. Nothing more, nothing less. However, we can achieve similar functionality to the Java enumerations via extension methods. For example, the following is a java enumeration.     1 public static enum Field {     2 ... [More]

Categories: ASP .NET
Permalink | Comments (1) | Post RSSRSS comment feed

Interfaces or Abstract classes?

Java allows enums to be defined in an interface. C# does not allow this. In the end abstract classes were used to implement some of these java interfaces in C#. However, one limitation is that multiple inheritance does not work for abstract classes. For a good comparison between C# interfaces and abstract classes, check out this article here.

Categories: ASP .NET
Permalink | Comments (0) | Post RSSRSS comment feed