Csharp Tutorial For Beginners

Tags: C#

Master C# fundamentals in 6 hours - The most popular course with 50,000+ students, packed with tips and exercises!

Last updated 2022-01-10 | 4.5

- Learn the fundamentals of C# and .NET Framework
- Work with primitive types and expressions
- Work with non-primitive types (classes
- structs
- arrays and enums)

What you'll learn

Learn the fundamentals of C# and .NET Framework
Work with primitive types and expressions
Work with non-primitive types (classes
structs
arrays and enums)
Learn the difference between value types and reference types
Control the flow of programs using conditional statements
Use arrays and lists
Work with files and directories
Work with text
Work with date and time
Debug C# applications effectively

* Requirements

* Visual Studio Community Edition (FREE)

Description

With over 50,000 happy students and 15,000+ positive reviews, this course is Udemy's most popular course for learning C# from scratch! 


C# is a beautiful cross-platform language that can be used to build variety of applications. With C#, you can build mobile apps (for Windows, Android and iOS), games, web sites and desktop applications.


Once you master fundamentals of C# and programming with .NET framework, you'll have lots of options in front of you. You can choose to build mobile apps if you prefer, or you can change job and work as a web developer. As long as you know the fundamentals well, switching to different technology stacks is pretty easy.


In this course, Mosh, author of several best-selling C# courses on Udemy, teaches you the fundamentals of C# programming in a clear, concise and step-by-step way. Note only that, but he'll also teach you best practices and shortcuts to help you become a better developer.


Every section comes with a few bite-sized video lectures and a quiz or programming exercises. These exercises are carefully chosen from academic and real-world examples to train your "programming brain". If you want to be a successful programmer, who has many high-paid job offers and freedom to "choose", you need to learn how to think like a programmer. And this is what you're going to get out of these exercises. All exercises come with solutions, so you can compare your solutions with Mosh's to find areas for improvement.


There are plenty of free tutorials and videos that teach you C# and they are great if all you want to learn is C# constructs. But if you want to learn C# and become a better programmer with a bright future and lots of options, this is the course for you. For every topic, not only will you learn the whats, but you'll also learn the whys, and hows. You'll see common errors that pop up as part of developing applications with C#. Mosh explains these errors in detail, and shows you how to resolve them.




THE COMPLETE C# PACKAGE

This course is the first part of Mosh's complete C# series on Udemy:

  • Part 1: C# Basics for Beginners: Learn C# Fundamentals by Coding 
  • Part 2: C# Intermediate: Classes, Interfaces and Object-oriented Programming
  • Part 3: C# Advanced: Take Your C# Skills to the Next Level



WHAT OTHER STUDENTS WHO HAVE TAKEN THIS COURSE SAY:

"I’ve actually landed my first job as a Junior software developer. I owe a lot of it to you because your courses have been EXTREMELY helpful. May God bless you and your efforts to create high quality courses. This has really changed my life from working as a security guard and doing websites for free, now I am a professional." -Danish Jafri


"Great Instructor, Great Course, Mosh does a great job of breaking down the material and making it interesting." -Michael Gardner


"You can hear the passion in his voice which makes the course sound 10x more exciting then someone who just does it for the money." -Tim Medcalf


"Great Instructor, I love the way he teaches the course." -Edward Tkachev


"I love Mosh's approach of delivering the theory and then the practice. Audio and video quality are superb." -Paul Mooney


"You can definitely tell that Mosh is not only an experienced programmer, but he also cares deeply about producing great quality lessons and ensuring that his students are understanding the content." -David



30-DAY FULL MONEY-BACK GUARANTEE

This course comes with a 30-day full money-back guarantee. Take the course, watch every lecture, and do the exercises, and if you feel like this course is not for you, ask for a full refund within 30 days. All your money back, no questions asked



ABOUT YOUR INSTRUCTOR 

Mosh (Moshfegh) Hamedani is a software engineer with 17 years of professional experience. He is the author of several best selling Udemy courses with more than 120,000 students in 192 countries. He has a Master of Science in Network Systems and Bachelor of Science in Software Engineering. His students describe him as passionate, pragmatic and motivational in his teaching.


Do you want to start learning C# now? 

Join the other 50,000+ happy students who have taken this course and start coding within a few minutes.


Who this course is for:

  • Newbies or students looking for a refresher on the basics of C# and .NET

Course content

11 sections • 96 lectures

What is this Course Preview 01:21

A brief overview of what you're going to learn from this course.

About Me Preview 01:40

Get to know your instructor, his educational background, work experience and interests outside programming.

A Note on Taking this Course Preview 00:14

Asking Questions Preview 00:33

Before You Get Started Preview 00:50

Introduction Preview 00:55

A brief overview of what you're going to learn in this section.

C# vs .NET Preview 00:53

What is the difference between C# and .NET? That's a common question amongst beginners that is answered in this lecture.

What is CLR? Preview 02:12

Learn about the run-time environment of .NET applications and how it is different from native C and C++ applications.

Architecture of .NET Applications Preview 02:42

Learn about the building blocks of .NET applications: classes, namespaces, assemblies

Getting Visual Studio Preview 1 page

Link to download Visual Studio Community Edition.

Our First C# Application Preview 09:53

Write your first C# program to get a feel for the language.

What is ReSharper? Preview 00:28

ReSharper is a commercial plug-in for Visual Studio that helps you write code faster with less effort. If you're a student or work on open-source projects, you can get a free license.

Fundamentals of C# and .NET

Summary Preview 01:13

A quick wrap of what you learned in this section and what is coming next.

Introduction Preview 00:26

A quick overview of what you're going to learn in this section.

Variables and Constants Preview 08:43

How to declare variables and constants in C# along with guidelines on naming conventions and choosing the right primitive type.

Overflowing Preview 02:13

What is overflowing and the effect of checked keyword in C#?

Scope Preview 01:02

Where does a variable or constant has meaning? That's determined by the scope.

Demo: Variables and Constants Preview 11:27

A demo of declaring various variables and constants.

Type Conversion Preview 04:48

Various kinds of type conversion: implicit, explicit and conversion between non-compatible types using the Convert class.

Demo: Type Conversion Preview 10:16

Demonstration of a few type conversion scenarios along with a quick introduction to try/catch blocks.

Operators Preview 04:12

List of arithmetic, comparison, assignment, logical and bitwise operators.

What are Logical Operations? Preview 2 pages

Demo: Operators Preview 06:21

Demonstration of using operators to build expressions.

Comments Preview 01:43

Different types of commenting notations in C#.

Primitive Types and Expressions

Summary Preview 00:35

A quick wrap of what you learned in this section and what is coming next.

Introduction Preview 00:25

A quick overview of what you're going to learn in this section.

Classes Preview 05:55

How to create classes and objects and the effect of static modifier on fields and methods.

Demo: Classes Preview 08:27

Demonstration of creating classes and extracting them into separate files for better maintainability.

Structs Preview 01:28

A brief overview of structures and when to use them.

Arrays Preview 02:15

What arrays are, how to declare them and access their elements.

Demo: Arrays Preview 03:51

Demonstration of declaring arrays and accessing their elements.

Strings Preview 05:49

Different ways to create strings: using string literals, concatenation, String.Format and joining array elements. Also covers verbatim strings,

Demo: Strings Preview 07:42

Demonstration of various ways to create strings.

Enums Preview 01:47

What enums are and how to declare them.

Demo: Enums Preview 07:37

Demonstration of declaring enums and accessing their members.

Reference Types and Value Types Preview 03:14

Difference between reference types and value types and how they are managed in the memory.

Demo: Reference Types and Value Types Preview 05:48

Demonstration of reference types and value types and what happens in the stack and heap memory when you copy variables.

Demo: Reference Types and Value Types Preview 03:48

Demonstration of the impact of reference types and value types when passing arguments to methods.

Non-primitive Types

Summary Preview 00:56

A quick wrap of what you learned in this section and what is coming next.

Introduction Preview 01:13

A quick overview of what you're going to learn in this section.

Conditional Statements Preview 02:43

Overview of if / else and switch / case statements as well as the ternary operator.

Demo: If/Else and Switch/Case Preview 08:40

Here, we'll explore conditional statements using a few examples.

Example 1: a simple program that displays a different message based on the time of the day.

Example 2: a program that sets the price for a product depending on whether the customer is a gold customer or not.

Example 3: a program that displays a different message based on the current season.

Exercises Preview 01:10

You can get the solutions in the Supplementary Materials section of this lecture.

Iteration Statements Preview 04:00

Overview of for, foreach, while and do/while blocks and when to use each.

Demo: For Loops Preview 01:56

Here, we'll write a simple program to display even numbers from 1 to 10 in an incremental and decremental fashion.

Demo: Foreach Loops Preview 03:42

Here, we'll explore foreach loops using two examples:

Example 1: a program that displays each character of a name on a new line.

Example 2: a program that displays all numbers in an array.

Demo: While Loops Preview 07:00

Here, we'll explore while loops using two examples:

Example 1: re-write of the program to display even numbers from 1 to 10, but this time using a while loop.

Example 2: a program that continuously asks the user to enter their name, and it'll echo the name. You'll learn how to implement infinite loops.

Random Class Preview 09:05

You'll learn how to use the Random class to generate random numbers and strings (like a random password).

Control Flow

Exercises Preview 01:07

You can get the solutions in the Supplementary Materials section of this lecture.

Summary Preview 00:37

A quick wrap of what you learned in this section and what is coming next.

Introduction Preview 00:38

A quick overview of what you're going to learn in this section.

Arrays Preview 04:47

Multi-dimensional (rectangular and jagged) arrays, how to declare them and how to access their elements, as well as overview of a few useful methods in the Array class.

Demo: Arrays Preview 10:02

Here, we'll explore some useful properties/methods in the Array class to:

  • Get the number of elements in an array
  • Find an element in an array
  • Sort an array
  • Copy an array
  • Clear an array

Lists Preview 02:18

An overview of generic lists and how they are different from arrays, as well as useful methods in the List<> class.

Demo: Lists Preview 10:11

Here, we'll explore a few useful methods in the List class to:

  • Add one or a range of elements to a list
  • Remove an element from a list
  • Find an element in a list
  • Get the number of elements in a list

Exercises Preview 01:20

You can get the solutions in the Supplementary Materials section of this lecture.

Arrays and Lists

Summary Preview 00:38

A quick wrap of what you learned in this section and what is coming next.

Introduction Preview 00:17

A quick overview of what you're going to learn in this section.

DateTime Preview 06:20

An overview of the DateTime structure, how to get the current date/time, how to change dates, and how to format dates in various notations (long, short, date/time, etc).

TimeSpan Preview 07:28

An overview of the TimeSpan structure, different ways to create TimeSpan objects, and how to use them.

Dates and Times Quiz

This quiz tests your knowledge on DateTime and TimeSpan structures in .NET

Summary Preview 00:35

A quick wrap of what you learned in this section and what is coming next.

Introduction Preview 00:17

A quick overview of what you're going to learn in this section.

String Preview 04:24

An overview of useful methods in the String class, how to convert numbers to strings and vice versa, and explanation of format strings.

Demo: String Preview 12:28

You'll learn how to use the methods in the String class to:

  • Trim strings
  • Find the index of a character in a string
  • Break a string into parts
  • Replace parts of a string
  • Check if a string is null, empty or whitespace

Live Coding: Summarising Text Preview 11:18

Here, you'll see me writing a program to summarise a block of text. This is useful in the home page of blogs where you need to show a summary of each post.

StringBuilder Preview 01:07

An overview of the StringBuilder, how it is different from the String class and when to use it.

Demo: StringBuilder Preview 07:30

A demonstration of various useful methods in the StringBuilder class to add / remove something to a string.

Working with Text

Exercises Preview 01:15

You can get the solutions in the Supplementary Materials section of this lecture.

Procedural Programming Preview 08:45

Here, I'll introduce you to procedural programming and how to extract re-usable parts of your code into methods.

You can get the solution to the exercises in the Supplementary Materials section of this lecture.

Summary Preview 00:35

A quick wrap of what you learned in this section and what is coming next.

Introduction Preview 00:20

A quick overview of what you're going to learn in this section.

System.IO Namespace Preview 03:58

An overview of the System.IO namespace and various useful classes here to work with files, directories and path. I'll introduce you to File, FileInfo, Directory, DirectoryInfo and Path.

Demo: File and FileInfo Preview 05:50

Here, I'll show you how to:

  • Copy a file
  • Check if a file exists
  • Read the content of a file
  • Delete a file

Demo: Directory and DirectoryInfo Preview 06:01

In this lecture, you'll learn how to:

  • Create a directory
  • Find all files / directories in a directory
  • Filter the files / directories in a directory
  • Check if a directory exists
  • Delete a directory

Demo: Path Preview 02:53

Here, you'll see the benefit of using the Path class (over string searching methods) to

  • Get the file name from a path
  • Get the extension in a path
  • Get the directory name in a path

Exercises Preview 00:08

Working with Files

Summary Preview 01:00

A quick wrap of what you learned in this section and what is coming next.

Introduction Preview 00:21

A quick overview of what you're going to learn in this section.

Debugging Tools in Visual Studio Preview 10:24

Overview of debugging tools in Visual Studio, breakpoints, running the application in the debug mode, continuing execution (step over, step into, step out) and inspecting values of variables.

You can get the source code I've used in this video in the supplementary materials section of this lecture.

Removing Side Effects Preview 09:15

You'll see a fundamental problem in the example code in this section. It has a side effect. You'll learn how to remove side effects and write reliable code.

Defensive Programming Preview 07:44

You'll learn about defensive programming and how it helps writing more reliable code.

Call Stack Window Preview 01:46

How to use the call stack window to find your way in the code during a debugging session.

Locals and Autos Windows Preview 01:53

Difference between Locals and Autos windows and how they are easier to work with than watches.

Debugging Applications

Summary Preview 00:38

A quick wrap of what you learned in this section and what is coming next.

What's Next? Preview 00:50

What I'm going to teach you in the second part of this course.

Final Words Preview 01:01

Get My Other Courses with a Discount Preview 00:20