Author Archives: compitionpoint - Page 28
Properties
Properties are the C# standard for accessing private data members inside a class. They may behave like normal fields, but properties have getters which gets the value of the private data and setters which sets a value…
Encapsulation
Encapsulation or information hiding is the process of hiding the sensitive data of an object from a user and only providing him/her with what is necessary. When we define a class,…
Access Specifiers
Access specifiers determine the accessibility of a class method or data members. We’ll take a look at the public and private access specifiers. The public access specifier is used when you want to access a method or…
readonly Fields
The readonly keyword is used for fields that will not allow modification of ;readonly fields have similar characteristics as constants except that you can allow a readonly field to have no value from…
Destructors
Destructors are the opposite of constructors. Destructors are also special methods that are called when the object is being destroyed. Objects use the memory of your computer and if they are not removed…
Constructors
Constructors are special methods that are required to create or “construct” objects. They allow you to assign the initial values for each data member of an array and add codes that…
Defining a Class
A C# class let’s you define a user-defined data type that contains fields, properties, and methods. A class serves as a blueprint for an object. The object is the actual thing that follows the…
Object Oriented Programming
Object Oriented Programming (OOP) involves defining classes and creating objects that resemble real life objects. For example, consider a car. The car has properties such as color, speed, model, manufacturer and…
Structures
structures or structs are user-defined data types that can contain other variables as its fields and methods as its behavior. You can create your very own customized data type using structures. Let…
Converting Enumerations
You can converting enumerations to other values and vice versa. Enumeration values are actually numeric values that are just masked by their names so that they can easily be understood.…