C# Out parameters Vs REF parameters

  Рет қаралды 285,040

.NET Interview Preparation videos

.NET Interview Preparation videos

Күн бұрын

For more such videos visit www.questpond.com
For more such videos subscribe www.youtube.co...
See our other Step by Step video series below :-
Learn C# Step by Step goo.gl/FNlqn3
Learn Design Pattern Step by Step:- goo.gl/eJdn0m
Learn Angular tutorial step by step tinyurl.com/yc...
Learn MVC Core step by step :- tinyurl.com/y9j...
Learn Azure Step by Step :- tinyurl.com/y6...
Learn SharePoint Step by Step in 8 hours:- goo.gl/XQKHeP
Python Tutorial for Beginners:- • Python Tutorial for Be...
Learn Data Science in 1 hour :- tinyurl.com/y5...
Learn Power BI Step by Step:- tinyurl.com/y6...
Learn MSBI Step by Step in 32 hours:- goo.gl/TTpFZN
Learn SQL Server Step by Step tinyurl.com/ja4...
Learn Tableau step by step :- tinyurl.com/kh...
In this video we will try to understand what is the difference between C# Ref and Out Keywords.
We are also distributing a 200 page Ebook ".NET Interview Question and Answers". If you want this ebook please share this video in your facebook/twitter/linkedin account and email us on questpond@questpond.com with the shared link and we will email you the PDF.

Пікірлер: 182
@dnfvideo
@dnfvideo 3 жыл бұрын
Do not miss our Interview Question video series 30 Important C# Interview Questions : kzbin.info/www/bejne/eHzcn3h4hdacf68 25 Important ASP.NET Interview Questions : kzbin.info/www/bejne/ponQfpejf7p2Zsk 25 Angular Interview Questions : kzbin.info/www/bejne/Y5vIoKx6f6mmia8 5 MSBI Interview Questions : kzbin.info/www/bejne/a3abYmiXjaaqj7M
@torykidd7570
@torykidd7570 2 жыл бұрын
Six years later, you're still helping newbie programmers. Thank you.
@so_called_kabir_singh
@so_called_kabir_singh 10 сағат бұрын
Bro here I'm 9 years later
@ankitmvp
@ankitmvp 3 жыл бұрын
Shiv sir is the best mentor. He is the only one who can explain the complex concepts with ease, even to Microsoft devs. 😊
@Lisa-uq4ty
@Lisa-uq4ty 6 жыл бұрын
You are the first person who explained this in a way I could understand. Thank you!
@BlueHat1
@BlueHat1 Жыл бұрын
Wow! That's honestly the perfect example, thank you so much!
@kiPROBRos
@kiPROBRos 3 жыл бұрын
Ovo je najbolji tutorijal u vezi Ref parametra.
@ivanubiamaia9475
@ivanubiamaia9475 7 жыл бұрын
Great tutorial. Now it is very clear the difference between ref and out for me. Thank you!
@WickedFlamezZ
@WickedFlamezZ 3 жыл бұрын
Really great video, others are 16minutes long but this tells you everything you need to know in 6.
@sasirekha9523
@sasirekha9523 Жыл бұрын
Sir no other articles explained in this correct and prompt way. either it is confusing or left unexplained. you are nailing to the point. hats off to you sir always.
@alitalipakgun5535
@alitalipakgun5535 4 жыл бұрын
Wow described perfectly i have no question in my mind about differences between normal, out and ref paramaters after watching the video. Thx pal !
@Swati_JayRanjan
@Swati_JayRanjan 2 жыл бұрын
I'm really so impressed with the explanation. I have observed the pop up at 0.55 minutes time which puts the wrong statement for default . Could you please correct the same. Rest.... I'm a big fan of your every video. Happy Learning Sir.
@SumitGupta-wr3jf
@SumitGupta-wr3jf 3 жыл бұрын
I think 10 time to watch more than 7-8 min videos but you explanation is so sorted even half and hour video i see cause i clears my doubt from top to bottom so i can remember easily....
@satish6776
@satish6776 4 жыл бұрын
thank you so much!!! I watch many video but not clear this concept. clearly explained and easy example
@rjbb0377
@rjbb0377 Жыл бұрын
Thank you so much! I have had such a hard time trying to understand this, but after listening to you it is so much more clear.
@DirePantsDim
@DirePantsDim Жыл бұрын
Eight years later, and still the best explanation on this topic. You sir, are awesome.
@tko1176
@tko1176 Жыл бұрын
Thank you very much. I have a question when is it useful to use the out key world. usually when I call a function it is to do something with the parameters, why would I want the parameters to be generated by the function?
@akshaytalekar2880
@akshaytalekar2880 6 жыл бұрын
Ever Ever Simplest Explanation About REF OUT Keywords.
@d_cl
@d_cl Жыл бұрын
The clearest explication I found! Thanks!
@quaintnet103
@quaintnet103 9 жыл бұрын
I like all your videos! very informative.....Pls correct the dialog "by default the variables are passed by REF....." to by default the variables are passed by Value..." at 00.51
@basilio100
@basilio100 8 жыл бұрын
+Quaint Net I would say that PRIMITIVE types passed by value,....
@liubomirwm
@liubomirwm 7 жыл бұрын
Actually all types are passed by value, the difference is that primitive types contain their value in the stack and their stack variable (containing the value) is passed. So called reference types have a stack variable which contains not the value directly but the address to the heap (where the actual data is contained). When you pass a so called reference you pass the reference address by value.
@trenocio8541
@trenocio8541 5 жыл бұрын
@Taiwo Seiler As far as I know, it doesn't make any difference to add ref to a non primitive type
@jakebwhite9253
@jakebwhite9253 3 жыл бұрын
Thank you! This cleared up the difference. I don’t understand when would someone use “out” though, it seems dangerous!
@MarcV_IndieGameDev
@MarcV_IndieGameDev 5 жыл бұрын
Thank you for the video, helped me out.. or should should I say, helped me ref'd
@manpreet4all
@manpreet4all 5 жыл бұрын
Sir I think callee doesn't returns any thing... actually the changes are happening in a common address space in case of ref and out so values are refelecting... And in case of out it overwritting with 0 in callee so again common address space is overwritten.... Can you correct me plz where i am wrong.
@tamaraimani5068
@tamaraimani5068 Жыл бұрын
I appreciate your way of presentation..
@kskchaitanya
@kskchaitanya 6 жыл бұрын
Hi, can you explain more on this topic... How exactly CLR handles this passing using REF and OUT keywords... Please have a look at the example below: private static string ModifyString(string originalInt) { originalInt = string.Empty; return originalInt; } private static string ModifyString(ref string originalInt) { originalInt = string.Empty; return originalInt; } Both these cases are PassByRef because string is reference type... but using the ref keyword, the changes propagate to the caller. My question is, how is the CalledMethod modifying the pointer information of the CallerMethod - (when the value in the CALLEDMETHOD changes, String creates a new memory location for the new value and assigns the new value location to the CALLEDMETHOD and the CALLERMETHOD at the same time).
@मयंककेला
@मयंककेला 4 жыл бұрын
thank you very much but better in (Hindi, Sanskrit ) AnyWay Nice Vdo in Detail Proper Explanation
@alex_fromrsa4815
@alex_fromrsa4815 Жыл бұрын
This just simplified the most confusing part of methods for me in 6 minutes. Thanks
@gnitin0384
@gnitin0384 2 жыл бұрын
Thank You!! It cleared my long standing doubt
@stewiegriffin6503
@stewiegriffin6503 2 жыл бұрын
I understand it. Thanky you. But what would be the idea behind introducing OUT function ? I guess they needed to make some pattern easier. But I don't see any practicaly use of OUT.
@chezchezchezchez
@chezchezchezchez 2 жыл бұрын
Saving CPU cycles and memory and time. No need to pass the data in? Use OUT!
@RayanMADAO
@RayanMADAO 2 жыл бұрын
I didn't even know about the step by step bugger (f11) before this video, that's a really cool and helpful feature
@nandorbacso4625
@nandorbacso4625 4 жыл бұрын
It was a really good and well understandable video! Thanks, man!
@mohammedzaid3829
@mohammedzaid3829 2 жыл бұрын
sir very good explanation,, you have covered the concept within very short time..!!
@mylapalliravi9920
@mylapalliravi9920 3 жыл бұрын
i liked the way of explanation ...easy thank you boss
@CarlosRamirez-jh8yw
@CarlosRamirez-jh8yw 3 жыл бұрын
Best explanation yet! Thank you
@geetasharma463
@geetasharma463 2 жыл бұрын
superb explanation thanks now iam confident
@glasgood9907
@glasgood9907 Ай бұрын
Fantastic explanation, thank you so much 👍🏼
@RahulGupta-jk9lb
@RahulGupta-jk9lb 3 жыл бұрын
I was confused for ref and out parameters. Now It is clear, thanks!
@snowblind112
@snowblind112 3 жыл бұрын
Perfect explanation, I was totally lost before I found your video. Thank you!
@jayadulshuvo5857
@jayadulshuvo5857 4 жыл бұрын
That was the easiest explanation of the topic. Thank you.
@ashishaswal7396
@ashishaswal7396 4 жыл бұрын
thank you for this video.. on the net there were all bullshit differences.. now is the main practical difference that made sense why we use them.. keep making these types of videos
@ronelperez2565
@ronelperez2565 6 жыл бұрын
Thank you. Simply explained but very understandeable.
@LucasofAppalachia
@LucasofAppalachia 8 жыл бұрын
Thank you! Very clear explanation with good examples.
@nishanthgmk3487
@nishanthgmk3487 3 жыл бұрын
The best explanation ever seen, no more doubts
@yashgupta8336
@yashgupta8336 4 ай бұрын
Brilliant explanantion, Thank you!!!
@aungpaingphyo218
@aungpaingphyo218 2 жыл бұрын
thanks alot!I was having trouble differentiating those two
@romesupaila1864
@romesupaila1864 Жыл бұрын
Clean explain ,but I have one query difference between function and method
@mehmetalper6156
@mehmetalper6156 3 жыл бұрын
Very good explanation thanks
@sery152
@sery152 5 жыл бұрын
a VERY GOOD EXPLANATION!
@artwolfgirl
@artwolfgirl 2 жыл бұрын
Thank you for the clear video!
@BattleandBeyond
@BattleandBeyond 9 ай бұрын
Awesome explanation.
@tngerik14
@tngerik14 8 ай бұрын
Very good explanation! But please say "by value" instead of "by val", as I think this might confuse beginners
@niluniverse
@niluniverse 7 жыл бұрын
Absolute Explanation ! Thank You Very Much Shiv !
@grandmagus8618
@grandmagus8618 4 жыл бұрын
is it necessary to define variable while using REF? I think on OUT situation it is not necessary to define variable.
@kalinduabeysinghe8917
@kalinduabeysinghe8917 Жыл бұрын
Beautiful explanation!!!
@vikramsharma4264
@vikramsharma4264 6 жыл бұрын
you are the best teacher !!
@tauseefakram90
@tauseefakram90 2 жыл бұрын
Very clear explanation with basic example. Thanks !! :)
@srinivasaraoyp3640
@srinivasaraoyp3640 5 жыл бұрын
Very nicely explained Sir. I enjoyed your video...Thank you....
@MyVideoFinder
@MyVideoFinder 9 жыл бұрын
Very nice informative.. I will be very helpful if you able to give links of your domain for the same question in KZbin description.
@dnfvideo
@dnfvideo 9 жыл бұрын
+Abdul Qayyum For more info and materials visit www.questpond.com
@MyVideoFinder
@MyVideoFinder 9 жыл бұрын
ok thanks..
@RayanMADAO
@RayanMADAO 2 жыл бұрын
So basically out only passes the reference and ref passes both the reference and the value?
@pranavb9768
@pranavb9768 2 жыл бұрын
Great explaination sir!
@tvsnmurthy2370
@tvsnmurthy2370 6 жыл бұрын
Hey I want to know In which scenario both are using?
@chezchezchezchez
@chezchezchezchez 2 жыл бұрын
LOL weird no one is talking about THAT!!!!!!!!!!!!!
@Dismanameboi
@Dismanameboi 2 ай бұрын
Amazing explanation once again
@venkatraman4762
@venkatraman4762 2 жыл бұрын
Great Explanation.
@EduTainer
@EduTainer 5 жыл бұрын
What Compiler are you using?
@preeti1820
@preeti1820 3 жыл бұрын
Thank you Sir! This video helped to clear my doubt.
@hajirrasouli1458
@hajirrasouli1458 3 жыл бұрын
Thank you. Your video helped me a lot!
@AlbrechtJ
@AlbrechtJ 3 жыл бұрын
Thanks for a clear explanation.
@alexseresalex1843
@alexseresalex1843 3 жыл бұрын
Your are bloody amazing SHESHARPP!!!! thanks for the content
@pritambunkar1110
@pritambunkar1110 3 жыл бұрын
thank you so much sir it's very helpful for me. keep it up
@jorgecardona3432
@jorgecardona3432 Жыл бұрын
Really well explained, thank you!
@hagbard6880
@hagbard6880 6 жыл бұрын
This Video helped me a lot. Thank you.
@DarthJeremy364
@DarthJeremy364 Жыл бұрын
this is sooo clear thank you!
@suniljadhav589
@suniljadhav589 6 жыл бұрын
Nice explanation. Very easy to understand these type of concepts.
@SonuSingh-nj6vp
@SonuSingh-nj6vp 3 жыл бұрын
Then what is the benefit to pass the data in parameter what i passing as 20
@rambabumoorthy5808
@rambabumoorthy5808 5 жыл бұрын
easy to understand thank you
@mingosutu
@mingosutu 5 жыл бұрын
Thanks nice video, however, who is "He" and "Him" you keep using in your explanation?
@clarkx86
@clarkx86 5 жыл бұрын
"He" are the methods he's referring to.
@NEETHUMOHAN38
@NEETHUMOHAN38 5 жыл бұрын
Helped a lot.. Thanks a lot
@NoName-1337
@NoName-1337 4 жыл бұрын
Well explained, thank you.
@codingwithflavio8534
@codingwithflavio8534 2 жыл бұрын
Why would you pass arguments with out keyword instead of just returning them from the function the regular way?
@dalamattho2307
@dalamattho2307 5 жыл бұрын
Your video is helping me to give a strong interview thx
@gauravpun6749
@gauravpun6749 5 жыл бұрын
Thank you soo much ! Nice tutorial !
@alreadytakenindeed
@alreadytakenindeed 3 жыл бұрын
Great description, super simple and easy to understand example, thank you!
@leoc5473
@leoc5473 4 жыл бұрын
Incredibly helpful, thank you so much!
@TheSphynxoid
@TheSphynxoid 6 жыл бұрын
So they are lke static which allows you to pass even fonctions
@santhoshkumarkumaresan5201
@santhoshkumarkumaresan5201 5 жыл бұрын
Nice, to add more, the variables should be created before passing to the method for ref and , for out, we can create and pass in method call.
@dusan7873
@dusan7873 3 жыл бұрын
Well explained and simple. Thanks.
@owenlie
@owenlie 5 жыл бұрын
Best explanation
@imhappynow8471
@imhappynow8471 5 жыл бұрын
Thank you for nice example
@mimo8439
@mimo8439 6 жыл бұрын
Thanks u made it clear...
@alexmurghulia6484
@alexmurghulia6484 4 жыл бұрын
thank you for the explanation, it helped a lot, subscribed.
@giga_charge
@giga_charge 2 жыл бұрын
Very helpful! Thanks!
@theuntormented6560
@theuntormented6560 Жыл бұрын
I am very particular about the videos that I click the damned like button Trust me guys this is one of those ❤❤
@dillikumarreddy1579
@dillikumarreddy1579 4 жыл бұрын
Pretty helpful. Thank you.
@Monirmahir
@Monirmahir 7 жыл бұрын
This is worth watching
@Saandy_
@Saandy_ 8 жыл бұрын
Definitely cleared up some confusion. thanks!
@yaminiashok7962
@yaminiashok7962 7 жыл бұрын
you are saying when we use out keyword it will not carry data from caller to the callee but instead of insidevar=insidevar+10 just keep insidevar=10 and debug u can observe that value of insidevar=20 in the method somefunction I think you are wrong sorry if i am wrong please verify and confirm us
@nishant07kumar
@nishant07kumar 7 жыл бұрын
I also believe that in the case of out value will from the main method will be passed to the somefuncton but that value will not be any use as ultimately inside somefunction variable will be initialized and old value will be discarded and new value will be assigned.
@ourtube9405
@ourtube9405 5 жыл бұрын
So what is the exact use of out here?
@manpreet4all
@manpreet4all 5 жыл бұрын
If the person is wrong, they dont have time to reply...
@avinashraj25
@avinashraj25 5 жыл бұрын
Out is used when we need more Return from a function. Function can return Only one value so we have Out keyword. Yes it is of Ref type but we assign the values inside function to this parameter and use it outside of Function.
@jasper5016
@jasper5016 5 жыл бұрын
This is exactly what I thought. out is not actually passing value. Its returning value.
@Mysteria9
@Mysteria9 3 жыл бұрын
Fantastic explanation, thank you!
@Praxss
@Praxss 3 жыл бұрын
But why we use out keyword? means we are declaring variable in function anyway and there not 2 way
@rohansolse67
@rohansolse67 6 жыл бұрын
awesome way to explain concept dude
@desaimihir83
@desaimihir83 8 жыл бұрын
Well explained, in other words, simplified explanation.
@jasper5016
@jasper5016 5 жыл бұрын
Great video. Thanks. Explanation for out does not make sense. I think out is for returning the value.
c# (Csharp) and .NET :- Difference between IEnumerable and IEnumerator.
13:39
.NET Interview Preparation videos
Рет қаралды 495 М.
Life hack 😂 Watermelon magic box! #shorts by Leisi Crazy
00:17
Leisi Crazy
Рет қаралды 79 МЛН
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 105 МЛН
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 46 МЛН
LEARN how to pass VALUE TYPES  by REFERENCE in C# - Ref, In and Out
24:45
tutorialsEU - C#
Рет қаралды 4,6 М.
C# Delegates explained
8:47
.NET Interview Preparation videos
Рет қаралды 516 М.
What is the difference between “out” and “ref” parameters?
6:50
OOP interview questions :- What is the difference between Abstraction and Encapsulation ?
12:34
.NET Interview Preparation videos
Рет қаралды 784 М.
c# (Csharp):- What is the use of Yield keyword in c# ?
10:35
.NET Interview Preparation videos
Рет қаралды 275 М.
Abstract Class vs Interface (Real Application Use) in C# .NET
6:18
Interview Happy
Рет қаралды 69 М.
Life hack 😂 Watermelon magic box! #shorts by Leisi Crazy
00:17
Leisi Crazy
Рет қаралды 79 МЛН