C # Learning Series-difference between String and string,
Refer:Http://www.microsoftvirtualacademy.com/Content/ViewContent.aspx? Et = 9851 & m = 9832 & ct = 31042
If any error occurs, please correct it.
String:Class, System. String
String:Type, variable
There is no difference in nature between the two, both of which are System. String. string is just the alias of System. String.
The only difference is how to write according to the code conventions. For example, when declaring a variable, use a lower-case string, and use the upper-case String when using the System. String method.
Post Code below
Class Program {static void Main (string [] args) {/* There is no difference in code usage. In terms of usage specifications, you need to check whether the specifications comply with the code conventions */Console. writeLine (typeof (string); Console. writeLine (typeof (String); string name1 = "Gerry 1"; String name2 = "Gerry 2"; Console. writeLine (name1); Console. writeLine (name2); Console. writeLine (string. concat (name1, name2); Console. writeLine (String. concat (name1, name2); Console. readLine (); Console. readLine ();}}
C language ^ how to use
A1 = 0x01; // 0000 0001
A2 = 0x00; // 0000 0000
A3 = 0x03; // 0000 0011
A4 = 0x02; // 0000 0010
B1 = a1 ^ a2; // 0000 0001
B2 = a1 ^ a3; // 0000 0010
B3 = a1 ^ a4; // 0000 0011
^ XOR operator. The bitwise value is 0 and the difference is 1. See the example above.
//
Examples of simple and practical problems:
====================================
======= A ======= B =========
There are two circuits on the top. The two switches are a and B respectively. The opening status is \ [1], and the closing status is/[0].
If both circuits are enabled or disabled.
If a turns on [1], B turns off [0], and circuit 1 Powers on
=====================
If a disables [0], B enables [1], and circuit 2 powers on.
====================================
In summary, the circuit fails in the and B states simultaneously [0]. When a and B are different, the power is charged [1].
C language ^ how to use
A1 = 0x01; // 0000 0001
A2 = 0x00; // 0000 0000
A3 = 0x03; // 0000 0011
A4 = 0x02; // 0000 0010
B1 = a1 ^ a2; // 0000 0001
B2 = a1 ^ a3; // 0000 0010
B3 = a1 ^ a4; // 0000 0011
^ XOR operator. The bitwise value is 0 and the difference is 1. See the example above.
//
Examples of simple and practical problems:
====================================
======= A ======= B =========
There are two circuits on the top. The two switches are a and B respectively. The opening status is \ [1], and the closing status is/[0].
If both circuits are enabled or disabled.
If a turns on [1], B turns off [0], and circuit 1 Powers on
=====================
If a disables [0], B enables [1], and circuit 2 powers on.
====================================
In summary, the circuit fails in the and B states simultaneously [0]. When a and B are different, the power is charged [1].