Third, variable

Source: Internet
Author: User

using system;using system.collections.generic;using system.linq;using system.text; Namespace _3. Variable {    class program    {         static void main (String[] args)          {            //  integer Types              sbyte mySbyte = 45;             byte myByte =  (byte) mysbyte;             console.writeline ("mySbyte =  {0} ",  mysbyte);             Console.WriteLine ("Mybyte = {0}",  mybyte);                         int myInt = 486255;             console.writeline ("myint = {0}",  myInt);                          float myFloat = 3.14F;             console.writeline ("myfloat = {0}",  myfloat);                          bool myBool1 = true, myBool2;             myBool2 = false;             console.writeline ("mybool1 = {0}",  mybool1);           &nbSp; console.writeline ("mybool2 = {0}",  mybool2);                          Console.readkey ();        }    }}/** *  A , the basic concept of variables  *  (1)   variable is a name for the program to manipulate the store.  *  (2)   Each variable has a specific type, and the type determines the memory size and layout of the variable.  *  *  naming rules for variables  *  (1)   variable names by numbers, letters, underscores (_), and @.  *  (2)   cannot start with a number.  *  (3)   cannot use keywords as variable names.  *  *  syntax for declaring variables  * <data_type> <variable_list>; *   *  parameter Parsing: * <data_type>:  valid C # data types.  * <variable_list>:  one or more comma-delimited identifiers.  *  *  Initialization of variables  *  (1)   declaring variables before initializing  * <variable_name> =  <value>; *  *  parameter parsing: * <variable_name>:  variable name  * <value>:  value  *  *  (2)   Initialize when declaring a variable  * <data_type>  <variable_name> = <value>; *  *  parameter analysis: &NBSP;*&NBSP;&LT;DATA_TYPE&GT;:   Valid C # data types  * <variable_name>:  variable names  * <value>:  values  *   *  Note: Using uninitialized variables results in compilation errors.  *  *  Five, Lvalue, and rvalue  * <lvalue>: lvalue expressions can appear to the left and right of an assignment statement. An  * <rvalue>: rvalue expression can appear to the right of an assignment statement, but not to the right of an assignment statement. The  *  *  variable is <lvalue&gt, and the value is <rvalue>.  *  *  vi. Variable Command conventions  *  (1)  pascalcase naming conventions  * eg. *       int age; *      string lastname; *       double WinterOfDiscontent; *   *  (2)   CamelCase Naming Conventions  * eg. *      int age; *      string firstName; *      double  timeofdeath; */


This article is from the "MK IT Life" blog, so be sure to keep this source http://vikxiao.blog.51cto.com/9189404/1585717

Third, variable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.