C# Supports 4 basic features of object oriented languages:
- Abstraction
- Encapsulation
- Polymorphism
- Inheritance
Can I say C# is a fully Object Oriented Programming Language? Why?
C# Supports 4 basic features of object oriented languages:
Can I say C# is a fully Object Oriented Programming Language? Why?
Some purists will insist that C# is not fully object-oriented because it lacks multiple inheritance.
No one knows what "100% object oriented" means. Probably C# is not since not everything is an object.
Some things that aren't objects:
It depends on your definition of "Object Oriented Programming Language".
Using your definition, yes C# meets 100% of the requirements:
- Abstraction
- Encapsulation
- Polymorphism
- Inheritance
However, C# contains features that aren't strictly "Object Oriented" such as
So I would say that, regardless of the definition you want to use, C# is not a pure Object Oriented Programming Language.
Lots of features make C# not totally object-oriented. However I don't believe any language is 100% "object oriented" and (almost?) all languages are at least a bit multi-paradigm. For instance, delegates. A very biased source points out that delegates, a construct in C# that I love, is not a "first class citizen" among objects. Java doesn't support multiple inheritance but I believe that's the most object oriented language there is. C++ does but is clearly not 100% object oriented, as a 100% function-based C++ program can easily be written (just compile almost any C program).
It depends more on the use of the language than the language itself. It's oriented towards objects but not exclusively comprised of objects, just like other languages. Will answering this question help anyone write significantly better code? I personally don't think so -- Richard Feynman said "I learned very early the difference between knowing the name of something and knowing something." It doesn't matter if it can be called "object oriented" as anything from Perl to Python to CIL to Ada has object-oriented features, and C# has features that are not object oriented.
Yes, you can say that C# is a fully object-oriented language. Think of it this way, it not only supports the four criteria of OOP, it also requires that essentially all of your constructs be encapsulated in objects (enums or value types not being pure OOP wouldn't sway me as being a particularly important exception). That is, C# doesn't let you develop outside of the OOP methodology in any meaningful way. Where people sometimes say a language isn't truly OOP is where object orientation is optional - such as C++ where you can develop in pure C if you wish.
One note: Steven points out that it doesn't support multiple inheritance. However, that doesn't disqualify it: OOP isn't dependent on the inclusion of this feature (and experience has taught us that it is, at best, a mixed blessing). That would be like saying that a car isn't a "car" unless it has a back-up camera since some cars have them.