Key Concepts

Review core concepts you need to learn to master this subject

Variables and Types

string foo = "Hello"; string bar = "How are you?"; int x = 5; Console.WriteLine(foo); // Prints: Hello

A variable is a way to store data in the computer’s memory to be used later in the program. C# is a type-safe language, meaning that when variables are declared it is necessary to define their data type.

Declaring the types of variables allows the compiler to stop the program from being run when variables are used incorrectly, i.e, an int being used when a string is needed or vice versa.

Data Types and Variables
Lesson 1 of 3

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo