The Linked List is a data structure in which items are not located in contiguous memory. Instead, each element points to the next one.
In some of the programming languages, there is a built-in Linked List data structure, despite this, we can create our own data structure. If we create a custom Linked List, we will be able to edit it as we want.
In general, Linked List has three types:
All of the programming languages which have Object-Oriented Programming (OOP) feature have classes and objects. We can think of a class as the blueprint for creating objects.
To understand them, let’s see the real-world example:
We have an
Animal class, and
Cat object which is the object of the
Animal class. Animal class has some specifications like their color, height, average life expectancy and so on. If we create an object of it with the name of
Cat, then it will have all of those specifications.
Similarly, if we look at the Object-Oriented Programming, we can see that a class defines some fields, properties, methods etc. …
Method Overriding, in Object-Oriented Programming, is a language feature that allows a child class to implement a method that’s is already is in the parent class. Implementation in the subclass overrides the implementation in base class by creating a method that has the same name.
To understand overriding, let’s look at the real-world example:
Let’s say we have an
Animal class and we have three different animals:
Arrays and lists are the most used data structures in C# programming language. Both of them store data like integer, string, instances of the class, and so on. They seem very similar at first glance, but actually, they have some necessary differences which affect their usages. Depends on the situation we can prefer to arrays than lists or vice versa. In this blog, I am going to explain which one is better based on what we want to do.
Initially, let’s look at the Array’s definition:
An array is the data structure that stores a fixed number of literal values of the same type. If we want an array with the different types in it, you can define “object” as its type (object type is not preferable, because they are complex). …
Most of the people (including me) who start with Unity are having a problem with learning
Time.deltaTime. To understand how it works, firstly, I will explain its definition. Then I will show a step-by-step example.
Time.deltaTime is the completion time in seconds since the last frame. This helps us to make the game frame-independent. That is, regardless of the fps, the game will be executed at the same speed. Let’s understand what this means:
Suppose, our game runs at 60 fps. …
In our last article, we talked about the Linked List and how its basic version is created. In this article, we are going to talk about the common methods of it.
If you did not read the first tutorial, I suggest you to take a look at it:
So, if we are ready, let’s get started:
To use the Linked List, we will create some methods for insertion, deletion, etc. operations.
Firstly let’s have a look at the insertion methods:
We can insert a node to the beginning, end, or middle of the Linked List. Let’s see them one-by-one:
Let’s say we have a Linked List like in the image below and we want to insert a new node to the beginning. …
Game Development is one of the most popular programming fields. When we want to make games and if we are new to programming, of course, we would not want to reinvent the game engine. Instead, we can use the engines which already exist. There are many game engines like Unity, Unreal Engine, Godot Engine, GameMaker and so on. One of the popular engines of these is the Unity Engine.
Unity is a game engine developed by Unity Technologies. …
When I am working with Unity, I have learnt some very useful attributes. For the first time, when I learnt them, I got surprised about how helpful they are. They help us in using the inspector easier, saving your time, and so on. For example, I have learnt the
Header attribute that helps us to organize our variables in the inspector. Imagine, you have lots of variables and do not use
Header, how messy they are going to seem! Fortunately, we have these kinds of stuff in Unity. …
Method Overloading (Polymorphism) in C#
In this blog, I am going to explain what is Method Overloading, also known as Polymorphism.
Let’s say we want two different methods with the same name. If we define methods like this, it would give us compiler error:
CS0111: Type “Class_Name” already defines a member called “MyMethod” with the same parameter types
So, this is where Method Overloading would be useful. Basically, Method Overloading means “defining method with the same name in different forms.” They can be overloaded in 3 different ways: