C# Data structures: Class vs. Struct vs. Record

preview_player
Показать описание
🔥 CLASSES, STRUCTS, AND RECORDS are some of the pillars that make C# the beast of a programming language that it is, so not knowing them puts you at a significant disadvantage! Make sure to check this out!

📚 Or do you like to learn through BOOKS more? Our TINY C# PROJECTS BOOK!

We'll make sure to turn you into a true developer in no time!

Timestamps:
00:00 Introduction
00:19 Classes
01:41 Structs
02:43 This one is for you!
03:11 Records
04:56 So, conclusion? What are these datastructures?
05:42 Thanks for watching!

C# Data structures: Class vs. Struct vs. Record

So, what is a class?
A type that is defined as a class is a reference type. At run time, when you declare a variable of a reference type, the variable contains the value null until you explicitly create an instance of the class by using the new operator, or assign it an object of a compatible type that may have been created elsewhere, as shown in the following example:

And what is a struct?
A structure type (or struct type) is a value type that can encapsulate data and related functionality. You use the struct keyword to define a structure type.

And a record?
Beginning with C# 9, you use the record keyword to define a reference type that provides built-in functionality for encapsulating data. C# 10 allows the record class syntax as a synonym to clarify a reference type, and record struct to define a value type with similar functionality. You can create record types with immutable properties by using positional parameters or standard property syntax.

And, what is C#?
C# (pronounced "See Sharp") is a modern, object-oriented, and type-safe programming language. C# enables developers to build many types of secure and robust applications that run in .NET. C# has its roots in the C family of languages and will be immediately familiar to C, C++, Java, and JavaScript programmers. This tour provides an overview of the major components of the language in C# 8 and earlier. If you want to explore the language through interactive examples, try the introduction to C# tutorials.

C# is an object-oriented, component-oriented programming language. C# provides language constructs to directly support these concepts, making C# a natural language in which to create and use software components. Since its origin, C# has added features to support new workloads and emerging software design practices. At its core, C# is an object-oriented language. You define types and their behavior.

To learn more, make sure to watch the video, and we promise you that you'll become a C# developer by the end of the course! Have fun!

#csharp #coding #tutorial #learn #microsoft #net #datastructures #class #structure #record

TAGS
c#,.net,c-sharp,csharp,programming,visual studio,c sharp,learn c#,c# programming,c# tutorial,c# for beginners,learn c# programming,c# tutorial for beginners,c# course,tutorial,coding,visual studio code,algorithm,data structures and algorithms,linked list,stack,data structures,algorithms,sorting,dictionary,hash tables,c# data structures,class struct record,core,software engineering,how to code,clean code,dotnet,struct,class,structure,record

TutorialsEU offers you free video tutorials about programming and development for complete beginners up to experienced programmers.
This includes C#, Unity, Python, Android, Kotlin, Machine Learning, etc.

Рекомендации по теме
Комментарии
Автор

So good to have found your channel. Short descriptions with the actual examples and understanding concepts in such a short period of time and correctly. THank you.

shubhanginimje
Автор

Maybe good to mention that records can be immutable but don't have to be. It's possible to create mutable records

davidelsner
Автор

I finally understand what is records in C#

ВикторБелоусов-тк
Автор

is the C# Progress Academy course suitable for beginners ?

YetenekBURADA
Автор

Bad video. It doesn't only mention "record struct" case, but instead has TWO! integrations which take up to 10% of whole video time in total. Sht.

БолеславМалиновский-жф
Автор

You just showed syntax an nothing else. Where is the actual comparison of the types and their object behaviors? This video explains nothing

akshaya
welcome to shbcf.ru