Easy Learn C#

C# Terminology

Introduction

This page provides a quick reference guide to common C# terminology. Understanding these terms is essential for reading C# code and documentation.

Basic Language Elements

Term Meaning Example
Namespace Container for classes and other namespaces; organizes code and prevents name conflicts namespace MyProject { ... }
Class Blueprint for creating objects; contains data and methods class Person { ... }
Method Block of code that performs a specific task void PrintName() { ... }
Variable Container for storing data values int age = 25;
Statement Complete instruction that performs an action Console.WriteLine("Hello");
Expression Code that evaluates to a value x + 5
Parameter Variable in a method definition void Add(int a, int b)
Argument Value passed to a method parameter Add(5, 10);

Object-Oriented Terminology

Term Meaning Example
Object Instance of a class Person person = new Person();
Constructor Special method called when an object is created public Person(string name) { ... }
Field Variable declared in a class private string _name;
Property Member that provides access to a field public string Name { get; set; }
Interface Contract that defines a set of methods a class must implement interface IDrawable { void Draw(); }
Inheritance Mechanism where a class inherits characteristics from another class class Student : Person { ... }
Override Providing a new implementation of a method defined in a base class override void Print() { ... }
Overload Multiple methods with the same name but different parameters void Print(int x) { ... }
void Print(string s) { ... }

Keywords & Modifiers

Term Meaning Example
public Access modifier that makes a member accessible from anywhere public void Display() { ... }
private Access modifier that restricts access to within the containing class private int _id;
protected Access modifier that allows access from the class and derived classes protected void Initialize() { ... }
internal Access modifier that restricts access to the current assembly internal class Helper { ... }
static Modifier that makes a member belong to the type itself, not instances static void Main() { ... }
readonly Field that can only be assigned during declaration or in a constructor readonly int MAX_SIZE = 100;
const Constant value that cannot be changed const double PI = 3.14159;
virtual Method that can be overridden in a derived class virtual void Process() { ... }
abstract Class or method that must be implemented by derived classes abstract void Draw();
sealed Class that cannot be inherited from sealed class FinalClass { ... }
async Method that can perform asynchronous operations async Task ProcessDataAsync() { ... }
await Pauses execution until an async operation completes var result = await GetDataAsync();

Special Types

Term Meaning Example
Delegate Type that represents references to methods delegate void ProcessData(int x);
Event Notification sent by an object when something occurs public event EventHandler DataChanged;
Enum Type that defines a set of named constants enum DayOfWeek { Monday, Tuesday, ... }
Struct Value type that encapsulates data and related behavior struct Point { public int X; public int Y; }
Record Type for immutable data with value-based equality (C# 9+) record Person(string Name, int Age);
Tuple Type that groups multiple elements into a single value (string, int) person = ("John", 30);
Nullable Value type that can also be null int? nullableInt = null;
Task Represents an asynchronous operation Task task = GetValueAsync();
Lambda Anonymous function expression x => x * x

Common Shortcuts & Symbols

Symbol Meaning Example
{ } Curly braces: Define code blocks if (x > 0) { ... }
[ ] Square brackets: Array indexing int value = numbers[0];
( ) Parentheses: Method invocation, expression grouping Calculate(x, y);
; Semicolon: Statement terminator int x = 5;
. Dot: Member access operator Console.WriteLine();
: Colon: Inheritance, interface implementation class Dog : Animal
=> Arrow: Lambda expression, expression-bodied members public string Name => _name;
?? Null-coalescing operator string name = value ?? "Default";
?. Null-conditional operator int? length = text?.Length;
$ String interpolation $"Hello, {name}!"
@ Verbatim string literal @"C:\folder\file.txt"