30 Important C# Interview Questions : kzbin.info/www/bejne/eHzcn3h4hdacf68 25+ OOPS Interview Questions : kzbin.info/www/bejne/q2qcqHSld893rLM Software Architecture Interview Questions : kzbin.info/www/bejne/d6W3mJaYgbSkg68 20+ SQL Server Interview Questions : kzbin.info/www/bejne/iXbHcnluorh-iZY 10+ Power BI Interview Questions : kzbin.info/www/bejne/eaDdlGyNg6eFqpY 20 MSBI Interview Questions : kzbin.info/www/bejne/hKjCpHt7gNOCi6c SQL Server Joins : kzbin.info/www/bejne/gYXZint7o9mppJo SQL Step by Step - kzbin.info/www/bejne/q3jPl4NvpJyeo7s Angular Step by Step Tutorial for Beginners : kzbin.info/www/bejne/Y2q5lIptgqd3qZo 25 Angular Interview Questions : kzbin.info/www/bejne/Y5vIoKx6f6mmia8 25 Important ASP.NET Interview Questions : kzbin.info/www/bejne/ponQfpejf7p2Zsk 35 Important JavaScript Interview Questions : kzbin.info/www/bejne/kJOXlYOfbKh0hLc 20 MySQL Interview Questions : kzbin.info/www/bejne/b5nJm3Zjd9WMaJI 5 MSBI Interview Questions : kzbin.info/www/bejne/a3abYmiXjaaqj7M 20 PHP Interview Questions : kzbin.info/www/bejne/Z5PTf4avo7qlopo
@zerosandones75473 жыл бұрын
Constants: Constants based on "consts": - const fields are called compile-time constants - an absolute constant - the value of a const variable is set during the declaration itself - consts variables SHOULD have a value when declared - the const's value is stored in the IL code itself Constants based on "readonly": - the modifier readonly creates fields, which values cannot be changed once they are assigned. - don't need to define a value during the declaration itself (a readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer)) - readonly fields are called run-time constants - their values cannot be changed after assignment - this process(value assignment) happens during the execution of the program (in runtime)
@questpondvideos4 жыл бұрын
New Announcement from Questpond ".NET(C#) FUNDAMENTALS, .NET COLLECTIONS, GENERICS" Course now available @ 799 /12 $. If Interested visit this Link for Subscription with Questpond www.questpond.com/netc-fundamentals-net-collections-generics/cid22
@faisalraufpitafi13966 жыл бұрын
sir Aslam o alikum I am from Karachi Pakistan I like your teaching way Mashallah Mashallah you are perfect teacher and I will share your videos with my friends because I want they should learn .
@nocultist70503 жыл бұрын
This is a hidden gem of a channel.
@dnskk9 жыл бұрын
sir const are implicitly static so u need not to put static in front of them
@expertreviews11128 жыл бұрын
absolutely fantastic video. goodness me such good explanation. Be Blessed
11 жыл бұрын
Very helpful. Thank you. Never really understood the point of readonly until now.
@HikeThePlanets4 жыл бұрын
Thanks so much for explaining that so simply and thoroughly.
@RohanShirodkar297 ай бұрын
Thanks for sharing this informatational video
@aks-tech-17 жыл бұрын
I have one suggestion here. You can brief the topic and then explain the programming. You are good in all the way. I am your paid user
@olglez92303 жыл бұрын
Nice one. Very clearly explained with a good example. This may come up on an interview open day!
@pcm0it11 жыл бұрын
The static modifier is not allowed in a constant declaration.
@mradosovic3 жыл бұрын
Very nice explanation with a good example.
@harshsaxena053 жыл бұрын
excellent explanation thank you.
@venkateshpillay32133 жыл бұрын
Great sir 👌 Thank you
@amolshinde78323 жыл бұрын
Very good explanation, thanks
@marklitvin92917 жыл бұрын
Very well explained. Thank you!
@Shakti_Singh_Om3 жыл бұрын
Important point here is that constants are by default static. You can use static keyword with Readonly and not with constants.
@PanikGrafik2 жыл бұрын
Dont forget that the value IS STILL HELD !!!
@saurabhmahal135412 жыл бұрын
Great way to tell the difference ...thanks
@rohitjoshi32403 жыл бұрын
You declare the static Constructor and used the access modifier, which prone to error.
@kavithan19876 жыл бұрын
Instead of read-only we can use integer right..is their any difference in memory allocation
@sery1525 жыл бұрын
Can you explain the logic of static inline with const and readonly, they have contradictins...
@manjeetnandal15 жыл бұрын
Great sharing! Thanks....
@Albileon11 жыл бұрын
Really good, thanks.
@naterdanger39196 жыл бұрын
Forgive me if this was asked already, but is it necessary to label it constant to begin with? Why/When would we need to do such a thing?
@jvsnyc6 жыл бұрын
It is to protect you against goofy mistakes by yourself or others on your team. If something is logically a compile-time constant (or even readonly) if you try to change it later by mistake you can't. There are also optimizations that can be applied to values known not to change, but that is secondary.
@rjshukla_vlogs8 жыл бұрын
Hello Sir ji .. Its really nice example but i have 1 question here that we can't have static and const simultaneously ?? it is saying that you cant have static with the const ? Could you please let me know how this happens in your example ?? Thanks you so much for your help :)
@AachaLagaNa8 жыл бұрын
Seems that code is written in text editor not in any fiddler or vs ide.
@rjshukla_vlogs8 жыл бұрын
But while. Running the application how it is showing the correct output.
@tusharghude157 жыл бұрын
watch carefully he changed it (at 05:48 u can see suddenly public and static disappeared) ur rgt constants cannot be declared as static coz they are implicitly static u always use const like classname.const_var
@vatansoni64397 жыл бұрын
+tushar ghude good
@dineshkumarachari87572 жыл бұрын
@@tusharghude15 correct! but he not mention that point is important point.
@prateekbhardwaj99438 жыл бұрын
nicely explained
@sandeepadode17 жыл бұрын
My question is why to read only?A constant is constant right be it at compile time or at run time.Does it have any impact on the program?please help.What exactly is the use of using anyone among them?
@jvsnyc6 жыл бұрын
It is to protect you against goofy mistakes by yourself or others on your team. If something is logically a compile-time constant (or even readonly) if you try to change it later by mistake you can't. There are also optimizations that can be applied to values known not to change, but that is secondary.
@ahmadezzat90316 жыл бұрын
The const is by default static.
@rajarajanseeman67588 жыл бұрын
Still wondering how would you be able to mark as static in const variable? I see the below error Error 1 The constant 'xxx.Program.myproconst' cannot be marked static
@AachaLagaNa8 жыл бұрын
Seems that code is written in text editor not in any fiddler or vs ide.
@jvsnyc6 жыл бұрын
If it is not clear to anyone, that's right, it can't. Doubly confusing for C++ programmers coming over to C# because in C++ const has a different meaning and does not automatically imply static. In C# it appears const implies static and you can't say both just for fun or to be more clear. In C++ the same thing would be static const, because if you said just const you would get one for each object instance. C# has a readonly keyword that doesn't exist in C++.
@ankitsinha0073 жыл бұрын
A static constructor does not have access modifier
@pankajjha19144 жыл бұрын
thnku sir.
@zerosandones75473 жыл бұрын
static constructor in IL code is cctor
@MrJonnis138 жыл бұрын
Thank you
@yeshyuvi12 жыл бұрын
its good and thank u
@codewithparveenyadav7 жыл бұрын
useful
@smanputra11 жыл бұрын
great explanation and examples..
@hlch77742 жыл бұрын
const no need to use static
@lakshmisruthi13423 жыл бұрын
I wish I watched this video before attending interview :/
@williamwang2047 Жыл бұрын
i think u said wrong, PI should be const, as it never changed......
@semikolon42296 жыл бұрын
thanks, very useful
@wiepcorbier5 жыл бұрын
Stop the "you know" please.
@naturebc2 жыл бұрын
This is one of those things that makes a language worse. More complex for no good reason at all.