We may earn an affiliate commission when you visit our partners.
Course image
Mosh Hamedani

Whether you want to use C# to build web apps, mobile apps, desktop apps or games, understanding C# classes, interfaces and principles of object-oriented programming is crucial.

Read more

Whether you want to use C# to build web apps, mobile apps, desktop apps or games, understanding C# classes, interfaces and principles of object-oriented programming is crucial.

This course is the second part of Mosh's best-selling C# series and is all about classes, interfaces and object-oriented programming. In essence, you'll learn:

  • How to work with classes, constructors, fields, properties, methods and indexers
  • How to use encapsulation to reduce the impact of change
  • How to improve the robustness of your code
  • How to re-use code using inheritance and composition
  • Why composition is better than inheritance
  • How to build extensible applications using polymorphism
  • How to develop loosely-coupled, extensible and testable applications using interfaces

Why would you want to take this course?

The answer is simple: quality of teaching.

Mosh is a passionate software engineer with over 13 years of experience developing applications in C#. He is the author of several best-selling C# courses on Udemy and knows how to lead you through a series of baby steps in a logical way.

So, from the very beginning to the very end, you'll be confident that you'll be in good hands and watching every minute of the course, unlike the reading many free tutorials and videos, does not waste your precious time.

Each section is equipped with a balanced mix of theory and practice. At the end of each section you'll get exercises to master the concepts you learn in that section.

And one last reason: all videos are produced with high quality video/audio, to provide you the best learning experience.

I owe a lot of it to you because your courses have been 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

"Your courses have given me the confidence to get out of my dead end job and apply for a full time coding job. I am very happy to say that I just finished the job interview and they gave me the job. " -Dan Farnell

"Outstanding quality. I have come to learn that all Mosh's courses are top notch. This course is no different. The content is beautifully designed, well organized with great examples, and delivered in a clear and concise manner (with great video and audio quality). I also loved that this course includes exercises. Fantastic stuff. " -Roger Sæle

"Love it. This guy definitely knows what he's talking about. He strives to make his courses as comprehensive as possible and he teaches you several tricks along the way." -Jeb Watson

"As with all of his courses his passion and love for programming is infectious. He does a great job of intermixing theory with hard examples and cautions with practicality. If you learn better by watching and examples then reading and theory this is a must watch to move beyond the learning the syntax of c#." -Michael Paul

"Excellent course. All of Mosh's courses are very much worth taking if you really want to learn C# in a professional way. Not only does Mosh clearly describe the syntax of the language and explain the language concepts, but he also constantly emphasizes the importance of good programming practices" -Tony Zampini

NET Framework in 2002). Mosh is a full-time developer and what you are going to learn in this course is the result of his day-to-day work as a hardcore programmer along with years of studying,

100% MONEY- Take the course, go through the lectures, do the exercises, and if you're not happy, ask for a refund within 30 days. All your money back, no questions asked.

So do you want to take your C# skills to the next level? Then take this course now and get started.

Enroll now

What's inside

Learning objectives

  • Work with classes, constructors, fields, properties, methods and indexers
  • Use encapsulation to improve the robustness of the code and reduce the impact of change
  • Re-use code using inheritance and composition
  • Understand the problems with inheritance and how composition solves these problems
  • Change the behaviour of an application by extending its code, rather than changing it
  • Develop loosely-coupled, testable and extensible applications using interfaces

Syllabus

About this Course
What You are Going to Learn
Who is Your Instructor
Source Code
Read more
Exercises
Asking Questions
Before You Get Started
Classes

  • What are classes and why we need them
  • What is the difference between a class and object
  • How to create classes, fields and methods
  • The var keyword
  • Static members
Constructors
  • How to quickly initialize objects without a constructor
  • What is method signature
  • What is method overloading
  • Method parameter modifiers: params, out and ref
  • Why ref is a smell in the design of C# and why you should avoid it.
  • Defensive programming and how it improves the robustness of your applications.
  • Two ways to initialize fields (directly and via constructor) and the pros and cons of each
  • The readonly modifier and how it improves the robustness of your code

  • Public and Private access modifiers
  • What is encapsulation?
  • Why we should declare fields as private and provider public accessors
  • What are properties and how to create them
  • A quick way to create a property
  • What are indexers, how they are useful and how to create them
  • The Dictionary type

Summary
Association between Classes
  • What is class coupling
  • What are tightly coupled and loosely coupled applications like
  • Three ways to reduce coupling
  • What is inheritance
  • An example of inheritance in a real-world scenario: building an application like Power Point
  • How to represent inheritance using UML
  • How to re-use code using inheritance
  • What is composition
  • An example of composition in a real-world scenario: DbMigrator and Logger
  • How to represent composition using UML
  • How to create a composition relationship between classes in C#
  • Why inheritance can easily be abused by amateur designers / developers
  • Problems with inheritance hierarchies
  • Why inheritance results in tight coupling between classes
  • How composition provides a more flexible and loosely coupled design
Inheritance - Second Pillar of OOP
  • Why access modifiers are important and how they help writing better code
  • Examples of public, private, protected, internal and protected internal
  • Why protected breaks encapsulation and it's better to be avoided
  • Rules about constructors in inheritance hierarchies
  • The base keyword and how we can use that to pass control to base class constructors
  • What is upcasting and down casting
  • Rules about casting an object to a base or derived class reference
  • The as and is keywords
  • StreamReader and ArrayList classes
  • What are value types and reference types
  • What is boxing and unboxing
  • Why boxing and unboxing comes with a performance penalty
  • Why generic lists are better to use than ArrayList
Polymorphism: Third Pillar of OOP
  • What is polymorphism and how we can achieve it by method overriding
  • The virtual and override keywords
  • How to get rid of long switch/case or if/else statements and re-write them in an object-oriented way with polymorphism

  • What are abstract classes and members
  • The abstract and override keywords
  • Rules about abstract classes and inheriting from them
  • When to use abstract classes
  • What are sealed classes and members
  • The sealed modifier
Interfaces
What is an Interface?
  • Introduction to Unit Testing with MS Tests framework
  • How interfaces improve the testability of your applications

I'll show you how we can change an application's behaviour without changing its code, simply by using interfaces as extensibility points. I'll also introduce you to the open-closed principle of object-oriented programming.

One of the common misconceptions about interfaces is that they are used for implementing multiple inheritance. This view is fundamentally wrong yet there are many books, videos and posts that make such claim. In this video I'll explain why interfaces got nothing to do with inheritance, single or multiple.

Interfaces provide polymorphic behaviour, which is extremely powerful. In this video, you'll see how we can use an interfaces in a polymorphic way to design a loosely-coupled and extensible application.

What's Next?
Final Words
My Other Courses
Get My Other Courses with a Discount
Bonus: Students' Code Reviews
StopWatch Exercise
Stack Exercise
Workflow Engine Exercise

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Develops key principles of object-oriented programming in C#, which are applicable to Java, JavaScript, Python, C++, and other languages
Taught by Mosh Hamedani, a recognized expert in software engineering and C# development
Examines core aspects of C#, including classes, interfaces, inheritance, polymorphism, encapsulation, and object-oriented design patterns
Provides practical exercises and assignments to reinforce concepts and allow learners to build projects
Covers essential concepts for building high-quality C# applications
Introduces advanced concepts such as polymorphism and interfaces for designing extensible and loosely coupled applications

Save this course

Save C# Intermediate: Classes, Interfaces and OOP to your list so you can find it easily later:
Save

Reviews summary

Useful oop intro

According to students, this course is a good starting point for learning about classes and object-oriented programming. Learners say that the exercises are helpful for practicing the material. However, some students say that you should practice by developing applications on your own.
Helpful for beginners
"The course is a good introduction to classes and object oriented programming which the exercises help to re-enforce."
Requires additional practice
"This course is a good starting point, but you should develop a lot of applications on it."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in C# Intermediate: Classes, Interfaces and OOP with these activities:
Compile a glossary of key terms
Creating a glossary will help you memorize and understand the key terms used in this course.
Browse courses on Classes
Show steps
  • Review course materials and identify key terms.
  • Define each term in your own words.
  • Organize the terms alphabetically or by topic.
Seek out a mentor
Finding a mentor can provide you with guidance and support throughout your learning journey.
Show steps
  • Identify individuals in the field you would like to learn from.
  • Attend industry events or meetups to connect with potential mentors.
  • Reach out to individuals and express your interest in mentorship.
Review basic programming concepts
Revisiting basic programming concepts will provide a strong foundation for understanding the more advanced topics covered in this course.
Browse courses on Variables
Show steps
  • Review online tutorials or documentation on basic programming concepts.
  • Complete practice problems to reinforce your understanding.
Seven other activities
Expand to see all activities and additional details
Show all ten activities
Read Head First Java
This book provides a comprehensive overview of Java and object-oriented programming concepts, which will complement the topics covered in this course.
Show steps
  • Obtain a copy of the book.
  • Read one chapter per week.
  • Take notes and highlight important concepts.
Join a study group
Collaborating with peers can provide a supportive environment for learning and help you stay motivated.
Show steps
  • Reach out to classmates and form a study group.
  • Set regular meeting times and discuss course materials.
  • Share notes and quiz each other.
Review tutorials on inheritance
Watching tutorials can provide an alternative perspective on the concepts covered in this course and help you reinforce your understanding.
Browse courses on Inheritance
Show steps
  • Search for tutorials on inheritance.
  • Select a tutorial that aligns with your learning style.
  • Watch the tutorial and take notes.
Work through practice problems
Practicing with sample problems will help you apply the concepts you learn in this course and identify areas where you need more support.
Browse courses on Classes
Show steps
  • Identify a problem set related to the topic you are studying.
  • Set a timer for 30 minutes.
  • Solve as many problems as you can within the time limit.
  • Review your answers and identify any errors.
Implement a class in your favorite programming language
Building a class from scratch will help you solidify your understanding of their structure and functionality.
Browse courses on Classes
Show steps
  • Choose a class to implement.
  • Design the class interface, including properties, methods, and constructors.
  • Implement the class and test it thoroughly.
Build a simple application using object-oriented principles
Applying your knowledge to build a real-world project will help you synthesize and retain the concepts covered in this course.
Browse courses on Classes
Show steps
  • Define the requirements and design for your application.
  • Implement the application using object-oriented principles.
  • Test and debug your application.
Volunteer to mentor students struggling with the course
Mentoring others can not only strengthen your understanding of the course material but also positively impact your peers' learning experience.
Show steps
  • Reach out to your instructor or classmates to express your interest in mentoring.
  • Identify students who could benefit from your support.
  • Provide guidance and support on course-related topics.

Career center

Learners who complete C# Intermediate: Classes, Interfaces and OOP will develop knowledge and skills that may be useful to these careers:
Software Architect
Software Architects are responsible for designing, building, and maintaining the infrastructure of software systems. The course will help you develop the advanced skills needed for this role, such as designing extensible and loosely coupled applications using interfaces. You'll also learn how to use inheritance and composition to reuse code, and how to apply polymorphism to change the behavior of an application without changing its code.
Software Developer
Software Developers design, develop, and test software systems. This course will help you build a strong foundation in object-oriented programming, which is essential for success in this role. You'll learn how to work with classes, constructors, fields, properties, methods, and indexers, and how to use encapsulation to improve the robustness of your code.
Software Engineer
Software Engineers design, develop, and test software systems. This course will help you build a strong foundation in object-oriented programming, which is essential for success in this role. You'll learn how to work with classes, constructors, fields, properties, methods, and indexers, and how to use encapsulation to improve the robustness of your code.
Programmer
Programmers write and maintain code for software applications. This course will help you develop the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. You'll also learn how to use inheritance and composition to reuse code, and how to apply polymorphism to change the behavior of an application without changing its code.
Application Developer
Application Developers design, develop, and test software applications. This course will help you develop the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. You'll also learn how to use inheritance and composition to reuse code, and how to apply polymorphism to change the behavior of an application without changing its code.
Computer Programmer
Computer Programmers write and maintain code for software applications. This course will help you develop the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. You'll also learn how to use inheritance and composition to reuse code, and how to apply polymorphism to change the behavior of an application without changing its code.
Developer
Developers write and maintain code for software applications. This course will help you develop the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. You'll also learn how to use inheritance and composition to reuse code, and how to apply polymorphism to change the behavior of an application without changing its code.
Web Developer
Web Developers design, develop, and maintain websites. This course will help you develop the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. You'll also learn how to use inheritance and composition to reuse code, and how to apply polymorphism to change the behavior of an application without changing its code.
Systems Analyst
Systems Analysts design and implement computer systems. This course may help you develop some of the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. However, you will need additional training in systems analysis.
Data Analyst
Data Analysts collect, analyze, and interpret data to help businesses make better decisions. This course may help you develop some of the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. However, you will need additional training in data analysis techniques.
Computer Systems Analyst
Computer Systems Analysts design, implement, and maintain computer systems. This course may help you develop some of the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. However, you will need additional training in computer systems analysis.
Database Administrator
Database Administrators maintain and administer databases. This course may help you develop some of the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. However, you will need additional training in database administration.
Technical Writer
Technical Writers create documentation for software and other technical products. This course may help you develop some of the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. However, you will need additional training in technical writing.
Information Security Analyst
Information Security Analysts protect computer systems from unauthorized access and use. This course may help you develop some of the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. However, you will need additional training in information security.
Project Manager
Project Managers plan and execute projects. This course may help you develop some of the skills you need to succeed in this role, such as how to work with classes, interfaces, and object-oriented programming principles. However, you will need additional training in project management.

Reading list

We've selected 12 books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in C# Intermediate: Classes, Interfaces and OOP.
Provides a comprehensive overview of Java programming, covering the basics of the language as well as more advanced topics such as object-oriented programming and Java libraries. It good choice for beginners who want to learn Java from scratch, or for experienced programmers who want to brush up on their skills.
Comprehensive reference for Java programming, covering everything from the basics of the language to advanced topics such as concurrency and networking. It good choice for experienced programmers who want to learn more about Java, or for beginners who want to learn the language in depth.
Provides a collection of best practices for Java programming, covering topics such as object-oriented design, concurrency, and performance. It good choice for experienced programmers who want to improve their Java skills.
Provides a comprehensive overview of design patterns, which are reusable solutions to common software design problems. It good choice for programmers who want to learn how to design and implement object-oriented software.
Classic work on design patterns, providing a detailed explanation of each pattern and how it can be used to solve software design problems. It good choice for experienced programmers who want to learn more about design patterns.
Provides a set of guidelines for writing clean and maintainable code. It good choice for programmers who want to improve the quality of their code.
Provides a comprehensive overview of unit testing, which is the process of testing individual units of code. It good choice for programmers who want to learn how to write and use unit tests.
Provides a practical guide to test-driven development, which software development process that involves writing tests before writing code. It good choice for programmers who want to learn how to use test-driven development.
Provides a comprehensive overview of site reliability engineering, which software engineering discipline that focuses on the reliability of software systems. It good choice for programmers who want to learn how to design and operate reliable software systems.
Novel that tells the story of a fictional IT team that adopts DevOps practices. It good choice for programmers who want to learn more about DevOps.
Provides a comprehensive overview of domain-driven design, which software design approach that focuses on modeling the domain of a software system. It good choice for programmers who want to learn how to design and build software systems that are aligned with the needs of the business.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to C# Intermediate: Classes, Interfaces and OOP.
C# Advanced Topics: Prepare for Technical Interviews
Most relevant
C# Basics for Beginners: Learn C# Fundamentals by Coding
Most relevant
Beginning C++ Programming - From Beginner to Beyond
Xamarin Forms: Build Native Cross-platform Apps with C#
Microsoft Networking Fundamentals
Complete Linux Training Course to Get Your Dream IT Job...
Master the Coding Interview: Big Tech (FAANG) Interviews
C# Developers: Learn the Art of Writing Clean Code
Master the Coding Interview: Data Structures + Algorithms
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser