Variables kinds and roles - C#
Hello!
Holly molly we almost made it, we almost can make our own first program in C#! Still we need tones of knowledge, but it is almost end for total basics. So we can start!
In C# we have standard types for writing words and digits. For words we can use char or string which is array of char. String is very useful it have many functions which can make operations on him like cutting etc. In C# string is known size table - this mean you can not add to string chars and string, because it make new string and allocate new memory, so in situation where you want to build strings from strings you should use stringbuilder or stringbuffer - more in future.
in other hand we wave much more options for save digits, because digits have infinity in plus, minus and after dot. So we cant save every digit, but sometimes we can approximate the number that is why we are using short, int etc for casual digits and float, double etc for digits witch dot.
Different types are static variables which are global - exist even when class object not exist, but it can make sense to make it private sometimes. For example want you saw how many object of class exist etc. Static is one for every element in class so even if you have 100 object static variable is just 1 in memory.
That is all what i prepared for you today. Enjoy!
Ok, so we have the table for all of types