Case Analysis of variable initialization in C#
In this article, the editor introduces in detail the "case analysis of variable initialization in C#". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "case analysis of variable initialization in C#" can help you solve your doubts. Let's follow the editor's ideas to learn new knowledge.
Take a look at the following example, using various types of variables:
Namespace VariableDefinition
{
Class Program
{
Static void Main (string [] args)
{
Short a
Int b
Double c
/ * actual initialization * /
A = 10
B = 20
C = a + b
Console.WriteLine ("a = {0}, b = {1}, c = {2}", a, b, c)
Console.ReadLine ()
}
}
}
When the above code is compiled and executed, it produces the following results:
A = 10, b = 20, c = 30 read here, this "variable initialization example analysis in C#" article has been introduced, want to master the knowledge of this article also need to practice and use in order to understand, if you want to know more related articles, welcome to pay attention to the industry information channel.