Some Concepts of C# Development

Overview – An Interesting Framework C# is an OOP programming language, which is developed by Microsoft.  It can be a bit boring if we just talk about the language itself.  When I started learning to program, I always asked myself what I can do with this language or Framework.   With the Framework, it begins with a general…

Keyword: Static in C#

In C#, static means something cannot be instantiated in our development. In other words, we cannot create an object of a static class, and we access the static members without instantiating an object of a static class. Static Class Apply the static modifier before the class name and after the access modifier (public and private)…

Keyword: Internal & Public, Abstract & Sealed

Internal & Public In C#, once we defined a class and we can instantiate it anywhere else in our project that has access to the definition. By default, classes are declared as internal. With internal, it means the class is only accessible to the code in our current project. On contrast, keyword public allows classes…

Inheritance & Polymorphism in C#

Inheritance and Polymorphism are essential features of C#, and We encounter these features daily. It can be a bit difficult to familiar with these features. In this post, we will explore these two features, have fun. Inheritance Inheritance enables any class (Subclass) inherits from another (Parent-Class), which means Subclass will have all the members of…

Releasing Resource & The Syntax Candy

In C# practice, we may need to read or retrieve information from a text file; such as .text, .pdf and etc. It is a good practice of critical thinking in this scenario, what if other objects or classes need to read this file?The solution can be simple, and we can close the file or source…

Write() and WriteLine() in C#

I have been following some tutorial of C# and encountered an issue of Write() and WriteLine() function. What is the difference between them? They both print text on the console, but they operate differently based on new line character. Write() display the text without providing a new line character; whereas WriteLine() provides us with a…

Class Constructor in C#

Introduction Class Constructor is a particular method which is invoked automatically at the time of object creation.  Besides, Class Constructor does not return anything. In C#, a class can have multiple class constructors. Function of Class Constructor Set default value of a class’ properties The Initialisation, which initialises the data members (properties) of the new objects…

Abstract Class and Method in C#

Abstraction in C# is a process to hide the internal details, without generating affection on showing its functionality.  Compared with Encapsulation, Abstraction is an umbrella term, whereas Encapsulation is to protect a class’ properties from any corruption access. We can go a long way without needing an abstract class, but abstract class is a good approach…

Encapsulation Case Study – Get & Set Method

As we briefly discussed Encapsulation before, we understand the basic syntax and implementation. In this post, we mainly discussed Encapsulation’s access control- get & set method, in terms of Write & Read, Write-Only and Read-Only.

Encapsulation in C# – Private & Public

Encapsulation Encapsulation is a methodology in C# Programming language.  In terms of dictionary explanation, Encapsulation is the action of enclosing something in or as if a capsule.  Encapsulation in C# Practice & Benefits In C# (or other Object-Oriented Programming), Encapsulation wraps up of data under a single unit (class); and the data wrapped up can be…