C # study one (Basic, Class, Function, Array, Collection Interface)

zhaozj2021-02-16  51

I have recently learned the C # programming course. Now I have summarized the notes, there is no system to organize, I remember Notes in class, and the following sections are more programmed, because these notes have not been finished, so many codes have no detailed note, if When I have time, I will make the system's finishing, and there is no basic grammar introduction here, I hope everyone understands:

Basic: // Using OUT, no, J Assign initial value INT I, J; F (OUT I, OUT J)} // USING, Brand Download (Font thefont == New Font "Ariel ", 10.0F)) {} // constants constant INT i = 32; // Enumeration Enum e {a = 5, b = 8} INT i = (int) EA; // Turn Buff Data To String Encoding.ascii. GetString (buff, 0, bytesread) // read data string s = console.readline () int j = convert.Toint32 (s); // Get TextBox Value and Convert to Double Double LEFT = Double.Parse (TextBox1.text) Application.doevent (); // this will let App DEAL with EventArray: a [] a = new a [5]; // a [0] to a [5] is null int [] arr = new int = ] {1,2} int [] arr = {2,3,4,5} foreach (a a a in arr_a) {} for (int i = 0; i

Public, private, protected, security // First implicit conversion 3 is Roman Roman R4 = R1 3; // First explicit conversion 7.5 is Roman Roman R5 = R1 (Roman) 7.5;

// operator overload, first return int, then use implicit conversion public static Roman Operator (Roman L, Roman R) {Return (L.Val R.val);} // Explicitly convert public static explicit operator Roman (Float VAL) {Return New Roman (VAL);} // implicit conversion public static implicit operator Roman (int val);} // Properties, note case public int Age {get {return agn; } Set {age = value;}} // interface // interface method The MUST BE IMPLEMENT IN Class PUBLIC INTERFACE IA {} // IS Test Class Inherited IF (A IA) {IA C = (IA) A; } // AS test class inherits IA c = a as IA; if (c! = Null) {} // interface Properties Pubiic Interface IAA: IA {FLOAT F {Get; set;}} // mutiface Interface Inheritance Public Class C: IA, IB {}

转载请注明原文地址:https://www.9cbs.com/read-24455.html

New Post(0)