Equals and =
C # has two different types of equality: equal reference and equal value
= Compares whether the values of two variables are the same or whether the two references point to the same memory address.
The Equals () method compares whether the content of two objects pointing to the memory space is the same. That is, to compare whether two "reference types" are referenced to the same object, that is, whether the content of the two objects is the same.
Differences between public variables and attributes
A variable is called a field for a class.
Attributes are externally displayed features of the class. They are only public attributes. They are invisible to the outside of the class, such as how to encapsulate values (set) and how to encapsulate values (get. External users can only use it, but cannot control it. How to control operations is determined by the class itself.
Differences:
Attribute is encapsulation of fields
Attribute can control read/write variables. (Set get)
Attribute values can be assigned, but variables cannot.
When you bind data to an object, the data can be normally bound, and the variable won't work. When you need to set a value in the class to public, you should use attributes instead of variables.
@ Symbol
1: String Escape Character
"\" Is a special Chinese Character in c #. It represents an escape character. If it represents a common string "\", it must be \. Through the @ symbol, you can use "\" as a common character.
String path = "F :\\ vs2008 \ 1.txt ";
String path = @ "F: \ vs2008 \ 1.txt"; this is enough.
2: Use @ to represent a cross-line string
3: Keep the keyword identifier in the C # specification. @ can be the first character of the identifier (Class Name, variable name, method name, use the reserved keywords in c # as their own identifiers.
For example, public class @ class
Recently I changed to a new company. I feel pretty good. I have a lot to learn. I feel that the most difficult thing is regular expressions. The girl who will be regular expressions is very powerful. To answer this question, I should be eager to learn.
Yesterday, when the machine went out of service, I had to read the book. I felt good. These basic things should have been known for a long time, but I only learned yesterday that the Foundation is not good and the foundation is not good, so there are still a lot of things to be improved, and JX is always optimistic and optimistic ......