C# Programming Tutorial 10 - Value Types and Reference Types

preview_player
Показать описание


~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
Рекомендации по теме
Комментарии
Автор

Been programming professionally for a year now and had to watch this video today because of a reference type issue.

csabraxas
Автор

Really a great explanation for something quite complex. I only have one question.

If I'm correct, String is a reference type, right?
See my code below:

String nameOne = "Matthew";
String nameTwo = nameOne;
nameOne = "Andrew";

At the end of the code I expect both nameOne and nameTwo to be Andrew, but that's not the case. nameTwo stays Matthew.
Can we conclude that String is special case and however it's a reference type, it behaves like a value type?

Thanks in advance!

matthieusaenen
Автор

Very clear and simple illustration to a rather complicated and important subject. Thank you Caleb. I have a couple of questions:

This much I know:

- Value data types include: int, double, decimal, boolean, struct, enum
- Reference data types include: Array, String, Class.



So there's the question of passing reference data types by value or by reference & passing value data type by value.


Another part that's confusing a little bit is why you must create an instance of the struct even though it is a value type data.

Perhaps you can explain this?

BijouBakson
Автор

Just Loving your c# tutorials as a beginner. Thnks for making them!!

karanmungra
Автор

Thanks Caleb, I'm a software dev. I will suggest your videos to the people I know, they think my life as a software developer is great, they are so naive :)

petartrajkovski
Автор

wonderful video!! really thank you for this very clear explaination!!

alainleclerc
Автор

This series is way popular, and it was a bit weird to see the thumbs-downs. With no explanation. How rude. I think something some may have been upset about (again, they should have said) is that you say all reference types work the same, but we never mentioned immutability, and funny behavior around that. So some may be confused by how this works because they don't yet know that string is immutable:
string s1 = "woof";
string s2 = s1;
Console.WriteLine($"s1={s1}, s2={s2}");
s1 += " woof!";
Console.WriteLine($"s1={s1}, s2={s2}");

jvsnyc
Автор

Bro great job please continue awesome videos

kunnudev
Автор

You are extremely gifted in explaining complex ideas and concepts in very clear and easy-to-understand way. Thank you very much for your content. I've found it very useful!

alainlipowicz
Автор

Eh! Eh! Wait a minute... You're the best!

thomi-alexandre_gagnon
Автор

I'm a fan of the incremental progression through your videos.
Just a heads up - you're likely to get more views per video from your subscribers if you spread them out to only 1 or 2 releases per week.

Sethorion
Автор

The video gets blurry couple minutes in.

tosh