I. The role of break and Continue keywords
1. Break:
1.1 For switch structure, jump out of switch
1.2 For loop structure, end entire loop
2, continue
2.1 Only for loop structure, end this cycle, continue into the next cycle
2.2 This cycle, the code behind the continue does not execute
Second, an array of objects
1, Function: Save data (in the form of objects to encapsulate the different data types of values)
2. Declare an array, allocate the space class name [] Object array name =new class name [array length];
3. Assign Value
Mode 1:
Prepares the element, then declares the array, and saves the element to the array
Class Name Object 1=new class name ();
Object 1. Attribute 1= value 1;
................
Object 1. Attribute n= value N; .... You can create multiple objects and assign values to properties
Class Name Object N=new class name ();
Object N. property 1= value 1;
................
Object N. property n= value N;
Class name [] Object array name ={object 1, Object 2 ... Object n};
Mode 2: "Recommended"
Declare the array and assign the length, and then assign the values to the elements in the group
Class name [] Object array name =new class name [length];
* * Object array name [Subscript]=new class name ();
Object array name [subscript]. Attribute 1= value 1;
4. Iterating through an array of objects
foreach (class name Object name in object array name) {
Output Properties
If (object name!=null) {
Console.WriteLine (object name. Attribute name);
}
}
The break and continue in net and an array of objects