Checklist

Certification

You will get a certificate on completing this course.

University

This course is not affiliated with any university.

Price

This course costs very less.

Edvicer's Rewards

You can get a reward of 150 coins on buying this course. These coins can be redeemed for 1 coin= 1Re.

C# Equality and Comparisons

C# Equality and Comparisons

1425
Start anytime
Self paced
English
Course by
PluralsightCourses from Pluralsight
Certificate awarded
Intermediate
Login to earn 150Edvicer reward coin150 coins = INR 150

Limited Time Discount Offers

Save your money with Edvicer. Check out our premium courses with discount offers.

Discount offers - Edvicer

Limited Time Discount Offers

Save your money with Edvicer. Check out our premium courses with discount offers.

Map your Career

Not sure which job profiles this course will open for you? Check out our AI based tool to get a complete personalized career map.

Career Mapper - Edvicer

Map your Career

Not sure which job profiles this course will open for you? Check out our AI based tool to get a complete personalized career map.

Checklist

Certification

You will get a certificate on completing this course.

University

This course is not affiliated with any university.

Price

This course costs very less.

Edvicer's Rewards

You can get a reward of 150 coins on buying this course. These coins can be redeemed for 1 coin= 1Re.

Why should you choose this course?

Description

This course teaches you how equality and comparisons function in .NET and the correct way to implement equality and comparisons for your own types.

Syllabus

Equality for Floating Points
So Why Is Equality Hard?
Reference vs. Value Equality
Welcome and Course Overview
'Natural' vs. 'Plugged-In' Equality
Summary
Aims of This Course
The Equality/OOP/Type-Safety Conflict
Equality, Value Types, and Boxing
Multiple Ways to Compare Values
The ReferenceEquals() Method
Summary
The Virtual Object.Equals() Method
Overview
Equals() for Value Types
The Static Equals() Method
IEquatable<int> Demo
Object.Equals() - Review
Introducing IEquatable<T>
Equals() for Strings
IEquatable<T>, Strings and Reference Types
The == Operator for Strings
Equality for Tuples
== Under the Hood
Comparing == and Object.Equals()
Summary
== Never Works With Generics
Overview
The == Operator for Buttons
== Doesn't Always Work With Inheritance
The == Operator for Integers
The == Operator for Value Types
Overview
Implementing GetHashCode()
Overriding Object.Equals()
Implementing Equality: Review
Why Would You Implement Equality for a Value Type?
Testing the Code
How to Implement Equality for a Value Type
Summary
Implementing == and !=
Implementing IEquatable<T>
== and System.Object
Implementing Equality in the Derived Type
How NOT to Overload ==
The Importance of Being Sealed
The Dangers of Implementing IEquatable<T>
Making == Work With Inheritance
Understanding the Equality/OOP/Type-Safety Conflict
Setting Up the Demo
Implementing Equality in the Base Type
Why Implement Equality for Reference Types?
Overview
Summary
Comparisons vs. Equality in .NET
Overview
Comparisons Are Value Only
When Should You Implement IComparable<T>?
Implementing IComparable<T> Demo
Implementing the Comparison Operators
Implementing the Non-Generic IComparable Interface
What Is a Comparison?
IComparable<T> With Integers
Summary
IComparable<T> in Generic Code
Introducing IComparable<T> and CompareTo()
IComparable<T> for Reference Types
Combining Character Demo
Current Culture vs. Invariant Culture
Equality Comparisons for Strings
Chars and Unicode Code Points
Choosing a Compare Method
Setting Up the String.Compare() Demos
String Pooling and Interning
Summary
Overview
Combining Characters
Ordinal Comparisons
Uppercase/Lowercase Demo
Character Expansion Demo
Choosing a StringComparison Value
Surrogates
Character Expansions
The Static String.Compare() Method
Culture-Sensitive Comparisons
Default Comparers and Equality Comparers
Equality Comparers and IEqualityComparer<T>
IComparer<T> vs. IComparable<T>
The Comparer<T> Base Class
Why Do We Need Comparers?
The Inconsistent Sort Order Problem
How Collections Leverage Equality Comparers
Implementing IEqualityComparer<T>.GetHashCode()
Plugging the Equality Comparer Into a Collection
Overview
The StringComparer Type
Summary
Writing a Comparer
Implementing IEqualityComparer<T>.Equals()
Comparers and IComparer<T>
Implementing an Equality Comparer
Comparers as Singletons
The Problem of Inheritance (Again)
Overview
How Hashtables Use GetHashCode()
Other GetHashCode() Requirements
Exclusive OR for Hash Codes
Mapping Strings for Hash Codes
When Fields Are Not Used in Equality
Equal Objects Must Return the Same Hash Code
Putting the Hash Code Algorithm Together
Summary
A Basic Hash Code Algorithm
What Is a Hashtable?
Overview
Equality and Comparisons Interfaces - Review
IStructuralComparable
Structural Equality and IStructuralEquatable
Course Summary
Equality and Comparisons Methods - Review
Module Summary

What others say about this course

FAQs

Can you learn C# with Unity?

Yes, you can learn C# with Unity and vice-versa. It is a great synergy between these two technologies.

What are the top jobs that I can get from learning C#?

The top job profile for C# experts are Solutions Architect with an average salary of INR 21 LPA and Dotnet Developer with an average salary of INR 5 LPA. Get your career map for your skills here.

What can I learn after learning C#?

After learning C#, the top skills you can learn to open highest number of job profiles for you are Ajax, Asp Net, and AWS. The top skills that can get you jobs with highest salaries are AWS, Azure, and Java

Write your review of C# Equality and Comparisons

Facebook account of EdvicerLinkedin account of EdvicerInstagram account of Edvicer
Twitter account of EdvicerPinterest account of EdvicerYoutube account of Edvicer