Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Programming in C#: Exam 70-483 (MCSD) Guide

You're reading from   Programming in C#: Exam 70-483 (MCSD) Guide Learn basic to advanced concepts of C#, including C# 8, to pass Microsoft MCSD 70-483 exam

Arrow left icon
Product type Paperback
Published in Oct 2019
Publisher Packt
ISBN-13 9781789536577
Length 444 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
SrinivasMadhav Gorthi SrinivasMadhav Gorthi
Author Profile Icon SrinivasMadhav Gorthi
SrinivasMadhav Gorthi
Simaranjit Singh Bhalla Simaranjit Singh Bhalla
Author Profile Icon Simaranjit Singh Bhalla
Simaranjit Singh Bhalla
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Learning the Basics of C# FREE CHAPTER 2. Understanding Classes, Structures, and Interfaces 3. Understanding Object-Oriented Programming 4. Implementing Program Flow 5. Creating and Implementing Events and Callbacks 6. Managing and Implementing Multithreading 7. Implementing Exception Handling 8. Creating and Using Types in C# 9. Managing the Object Life Cycle 10. Find, Execute, and Create Types at Runtime Using Reflection 11. Validating Application Input 12. Performing Symmetric and Asymmetric Encryption 13. Managing Assemblies and Debugging Applications 14. Performing I/O Operations 15. Using LINQ Queries 16. Serialization, Deserialization, and Collections 17. Mock Test 1
18. Mock Test 2
19. Mock Test 3
20. Assessments 21. Other Books You May Enjoy

Understanding polymorphism

Polymorphism is a Greek word whose literal translation to English is many-shaped. In programming terms, it's referred to as one interface with multiple functions. Let's try to understand polymorphism by looking at the following diagram:

In the preceding diagram, we have some program code that runs on Input 1 and gives Output 1. Now, let's say we make a mistake and send an incorrect input of Input 2 instead. In this case, unfortunately, the program code may error out and send an error message. In such a scenario, we can use polymorphism. With polymorphism, the same example will be represented as follows:

As we can see, by using polymorphism, we will maintain three copies of the code in memory and depending on the type of input received, the appropriate copy of the program code will be loaded and executed.

There are two types of polymorphism...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime