In OOP, namespaces are containers for a group of classes which have a common context or are categorized by common functionality. Namespaces do not have any kind of functionality, and it is not mandatory to use them. However, they offer a few advantages, most notably being the ability of sorting and grouping your code into logical units.… Read more
Posts Tagged ‘OOP’
Namespaces
Wednesday, August 2nd, 2017Enumerations
Sunday, July 16th, 2017Structures
Saturday, June 24th, 2017In C# and .NET framework, there are two implementations of the concept of “class”, from the OOP point of view: classes and structures.
While we already know that classes are defined using the class keyword, structures are defined using the keyword struct.… Read more
Generic classes
Sunday, June 18th, 2017Generic classes, also known as generic data types or simply generics, are classes of unknown type until they are instantiated to some specific type.
Because this concept is a bit harder to explain, I will first exemplify a specific case that will help you better understand it.… Read more
Nested classes
Friday, June 9th, 2017C# offers nested classes, which just like all the other nested programming concepts, implies a construct (class) defined inside the body of another construct (class). The class defined this way is called “inner class”, while the one which contains it, is called “outer class”.… Read more
Static members
Thursday, May 18th, 2017As we saw in the previous recent lessons, the usual way of communicating with a class is to create instances (copies) of it, and then use the resulting objects. In fact, that is the strong advantage of the classes – the ability to create copies that can be used and can be modified individually.… Read more
Access modifiers
Sunday, May 14th, 2017As their name suggests, access modifiers are some programming concepts that can alter the access level of something. In more complex words, access modifiers are reserved keywords which add information for the compiler, and the piece of code related to those modifiers.… Read more
Instantiation
Wednesday, April 26th, 2017I have explained a few times already that when we are dealing with objects, most of the times we are not working with the original class itself – the blueprint, but we are actually create copies of it called instances.… Read more
Constructors
Tuesday, April 25th, 2017In object-oriented programming, when creating objects from given classes, it is sometimes necessary to call some special methods of those classes, known as a constructors.
Constructor of a class is a pseudo-method, which does not have a return type, has the name of the class and is called using the keyword new.… Read more
Properties
Sunday, April 23rd, 2017In today’s lesson, I will talk about one of the previous lesson’s new concepts. The first subject on the list: fields and properties. According to our beloved MSDN, a property is a member that provides a flexible mechanism to read, write, or compute the value of a private field.… Read more