1.static Keywords:
Static members in Java can be called by object and class name;
In C #, a static member can only be called by a class and cannot be called by an object.
2.for Loop:
In Java, you can add a tag to the for front and then break to specify a for loop for the token in the For loop;
In C #, break is jumping out of the current for loop without marking this thing.
3. Constructor Call:
In Java, calling a constructor in a constructor is through "This (parameter 1, parameter 2 ...)" Called directly in the function body of the constructor;
In C #, it is passed after the constructor ": this (parameter 1 ...)", for example----public person (string Name,int age,int weigh): this (name,age).
4. Constructing code blocks and static code blocks
In Java, you can define building blocks of code, which means that in a class, you write code directly in the "{Write Code}", which is loaded every time a class object is instantiated, and the static code block means "static{write code}", which is executed once when the class is loaded. Executes only once. It is the use of the class of things to execute the above two concepts, if only the declaration (not initialized or simply initialized to null) is not loaded, such as in the person class has the above two concepts, then declare the person p=null, so that the above two concepts will not execute the code, If person is p=new person (), then the two concepts are called. A static block of code executes before a block of code is constructed, because there are classes before objects. Execution order: Static code block--static property creation and initialization--with default merit property initialization--Construction code block--constructor
In C #, there is no concept of building blocks of code and static code blocks.
Syntax differences between Java and C # (constantly updated ... )