Skip to main content

Operator Overloading - C# Intermediate Tutorials

OPERATOR OVERLOADING IN C#
INTERMEDIATE TUTORIAL
by Chamuth Chamandana
What is Operator Overloading
=======================
Operator Overloading is one of a way of implementing Polymorphism in C# (OOP Concepts are going to be discussed in a basics video in future). Operator Overloading can be defined as adding operator functionality to custom types. This operators include all of the arithmetic operators, comparison operators, assignment operators and etc.
What we're going to talk about in this video
==================================
We're going to develop a class known as Number which is really simple and only has an integer (Int32) Property known as value. We're going to add custom operators overloaded to this class, namely ++, --, + and - operators.
Let me know what you want to know more about, in the comments section. If you enjoy please Subscribe to my channel and encourage us by liking our videos!!!

Comments

Popular posts from this blog

Animating Objects in WPF using Code Behind (C#)

A Feature that is built in to the WPF Platform is the ability to animate content without using Timers. That is inside the System.Windows.Media.Animation namespace. In this video, I'm going to help you with creating animations using the code behind (C#)

Command Prompt යනු කුමක්ද?

Microsoft සමාගම විසින් I/O (Input or Output) කර්‍යයන් පහසු කිරීමට Command Promt. නම් Console Based Program එක Windows හි Poor User Interfaced Controller Program එක ලෙස Windows සමගම Release කරන ලද Program එකකි. Command Prompt වැනි වැඩසටහනකට කර හැක්කේ මොනවාද? Command Prompt. වැඩසටහනෙන් තම පරිගණකයේ ගොනු පද්දතිය (File System) එක පාලනය කල හැකි බව ඔනෑම පුද්ගලයෙක් දන්නවා. එහෙත් මෙයි ඊට වඩා වැඩක් කරගත හැකි බව දැනගත යුතුය, එමෙන්ම එවැනි වැදගත් කරුණු මෙම ලිපියේ දී ඔබට දැනගත හැකිවනු ඇත. GUI එකක් තිබෙද්දී මෙය පාවිච්චි කරන්නේ ඇයි? GUI (Graphical User Interface) එනම් අපට ඇසට ප්‍රියජනක ලෙස දැකගත හැකිවන පරිදි Colors, Images වැනි Windows Controls යොදාගෙන සාදා ඇති අතුරු මුහුනතක් (Windows Explorer) Windows සමග ඔබට ලැබෙනු ඇත. එහෙත් සාම්ප්‍රදායිකව Windows සමග ඔබට ලැබෙන මේ වැඩසටහන පාවිච්චි කිරීමටද වැදගත් හේතු කිහිපයක් තිබේ. 1. Windows Explorer නම් වැඩසටහනට නොපෙනෙන හෝ Restricted කලාපයන්ට ඇතුලත් වීමට Command Prompt වැඩසටහනට හැකියාවක් ඇත. 2. Windows Explorer වැනි වැඩසටහනක් මේ වන විට දියුණුවෙන් දියු...

C:\ Drive එක Compress නොකල යුත්තේ ඇයි?

අප කවුරුත් දන්නවා Windows install කරපසුව C:\ නමින් ඇති Drive එක Windows Installation Drive එක වන බව. කොටින්ම කියනවානම් C:\ යනු පරිගණකයේ ඇති වැදගත්ම Hard Disk Partition එක ලෙස සැලකිය හැකිය. මන්ද Windows Run කිරීමට අත්‍යවශ්‍ය Files සියල්ලම ඇත්තේ C:\ නම් Disk එකේය. යම්කිසි Drive එකක් Compress කිරීමෙන් සිදුවන්නේ එහි ඇති Files Access වීමට පෙර යම්කිසි Algorithm එකකට Compress වීමයි (මෙය Disk Space එක වැඩි කරදෙයි). එම Files වලට හරි ආකාරව Access වීමේදී ඒවා නැවත Decompress වී Open වෙයි. මෙයට යම් කාලයක් ගතවෙයි. එහෙත් C:\ හැරුණු විට අනෙකුත් Drives වලට එයින් කිසිදු හානියක් සිදු වන්නේ නැත. C:\Windows\ යනු පරිගණකයේ Windows Installation path එක කියා කවුරුත් දන්නවා. එහි ඇති BootMGR වැනි Boot වීමට වැදගත් Files වලට Boot වීමේදී Decompress කිරීමට අවසරයක් නැත. එම නිසා ඔබගේ පරිගණකය ඔබට් Boot කිරීමට නොහැකි වනු ඇත.