Please note that this is an “Intermediate” article; it therefore assumes you have read all previous “Beginner” articles, and you know how to create an instance of a class. Introduction Generics allow a type or method to operate on objects of varying types, while providing compile-time type safety. They can be used to achieve parametric Read More →

Share

Note: This article assumes that you have read all previous “Beginner” articles, and you know how to create an instance of a class. Introduction Operator Overloading is a feature of C# that acts as syntactic sugar in the code, and eases the use of libraries in your programs. Because this feature is not present in Read More →

Share

Introduction When coding, I find that properties are a simple, yet useful, feature of the C# programming language. Properties enable the use of member syntax for setters and getters. With properties, you can read, write, or compute the value of a private field very flexibly. If you have used C++ or Java in the past, Read More →

Share

Introduction Officially, Java and C# do not support true multiple inheritance (or “MI”). In other words, classes belong to a single-rooted object, and can inherit from only one parent class. Keep in mind that interfaces can still be inherited multiple times by a class. The reason Java and C# give for not supporting MI is Read More →

Share

Please note that this article assumes you have read my previous tutorials on data types, variables, conditionals and loops, etc. and know how to properly compile a Hello, World! program. Introduction Arrays, which were mentioned briefly in Basic Concepts – Part 2, are found just about everywhere in code. In short, arrays are a simple Read More →

Share

Please note that this article assumes you have read my previous tutorials on classes, and you know how to create an instance of a class. Introduction In my previous article, I mentioned that methods (functions defined in a given class) marked as public are the only methods visible to the entire program. On the other Read More →

Share

Please note that this article assumes you have read my previous posts on data types, variables, conditionals and loops, classes, etc. and you are able to write a running Hello, World! program. Please do these before trying to create another DOOM or Crysis. Introduction A function is a way of packaging code that does something. Read More →

Share

Please note that this article assumes you have read my previous posts on data types, variables, conditionals and loops, etc. and you are able to write a running Hello, World! program. Introduction In Object-Oriented Programming (OOP), the most important concept is the class. As its name implied, this is especially the case in class-based OOP, Read More →

Share

A website about programming wouldn’t be very useful if I only showed snippets of code, and never a real-world example. In this post, I’m going to reveal code for an electricity calculator… and here’s how it works. The user starts up the program, types in some information, and the program tells the user some dollar Read More →

Share

No, I’m not referring to a common brand of mouthwash. In programming, “Scope” refers to the visibility of a variable, as seen from different locations of a program. Not all variables and objects are available for use by any procedure; that would be akin to a hotel room that leaves all of its doors unlocked, Read More →

Share