当前位置:首页 > C#教程 > C#进阶

C#进阶

C#多重继承

1

usingSystem;namespaceInheritanceApplication{classShape{publicvoidsetWidth(intw){width=w;}publicvoidsetHeight(inth){heigh

C#BitArray类

2

usingSystem;usingSystem.Collections;namespaceCollectionsApplication{classProgram{staticvoidMain(string[]args){//creating

C#while循环

2

usingSystem;namespaceLoops{classProgram{staticvoidMain(string[]args){/*localvariabledefinition*/inta=10;/*whileloopexecu

C#访问数组元素

4

usingSystem;namespaceArrayApplication{classMyArray{staticvoidMain(string[]args){int[]n=newint[10];/*nisanarrayof10intege

C#阶乘示例

0

usingSystem;namespaceMyApplication{classFactorial{publicintdisplay(intn){intres=1;while(n!=1){res=res*n;n=n-1;}returnres

C#调用方法示例2

3

usingSystem;namespaceCalculatorApplication{classNumberManipulator{publicintFindMax(intnum1,intnum2){/*localvariabledecla

C#单继承

3

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceMyAplication{classDemo{staticvoid

C#正则表达式示例3

2

usingSystem;usingSystem.Text.RegularExpressions;namespaceRegExApplication{classProgram{staticvoidMain(string[]args){stri

C#访问修饰符

1

usingSystem;namespaceMySpecifiers{classDemo{protectedstringname="Website";protectedvoidDisplay(stringstr){Cons

C#if...else语句

2

usingSystem;namespaceDecisionMaking{classProgram{staticvoidMain(string[]args){/*localvariabledefinition*/inta=100;/*chec

C#构造函数

0

usingSystem;namespaceLineApplication{classLine{privatedoublelength;//LengthofalinepublicLine(){Console.WriteLine("O

C#运算符重载

4

usingSystem;namespaceOperatorOvlApplication{classBox{privatedoublelength;//Lengthofaboxprivatedoublebreadth;//Breadthofa

C#查找三个数字中最大值

3

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceDemo{classMyApplication{staticvoi

C#交错数组

7

usingSystem;namespaceArrayApplication{classMyArray{staticvoidMain(string[]args){/*ajaggedarrayof5arrayofintegers*/int[][

C#检查当前线程的状态

3

usingSystem;usingSystem.Threading;namespaceDemo{classMyClass{staticvoidMain(string[]args){Threadthread=Thread.CurrentThr

C#抽象与虚拟动态多态

2

usingSystem;namespacePolymorphismApplication{classShape{protectedintwidth,height;publicShape(inta=0,intb=0){width=a;heig

C#递归方法调用

1

usingSystem;namespaceCalculatorApplication{classNumberManipulator{publicintfactorial(intnum){/*localvariabledeclaration*

C#匿名方法

2

usingSystem;delegatevoidNumberChanger(intn);namespaceDelegateAppl{classTestDelegate{staticintnum=10;publicstaticvoidAddN