
C#
iteye_12996
这个作者很懒,什么都没留下…
展开
-
C#属性 定义
using System;using System.Collections.Generic;using System.Text;namespace property{ class PropertyTest { private int age;//声明属性 public PropertyTest(int age) {//构...2010-05-02 18:18:56 · 249 阅读 · 0 评论 -
C# 泛型 简单应用
using System;using System.Collections.Generic;using System.Text;namespace DicrionaryTest{ public class Stack<T>//定义一个泛型类 { private int count;//元素个数 private ...原创 2010-05-22 23:45:33 · 149 阅读 · 0 评论 -
C# 多重传送事件
using System;using System.Collections.Generic;using System.Text;//多重传送事件namespace interfaceDemo{ //多重传送事件是指一个事件同时有多个订阅者,即通过委托将多个方法添加到该事件中,当事件被引发时,同时 //触发这些委托的执行 class Mutiply...原创 2010-05-22 22:02:54 · 172 阅读 · 0 评论 -
事件定义、订阅、引发事件 简单 实例
using System;using System.Collections.Generic;using System.Text;//事件允许一个对象将方式的事件通知其他对象,将发生的事件通知其他的对象称为发行者,同时对象也可以订阅事件,该对象//称为订阅者namespace interfaceDemo{//事件处理分为四步: //1、定义事件 //2...原创 2010-05-22 21:50:17 · 638 阅读 · 0 评论 -
C# 多重委托
using System;using System.Collections.Generic;using System.Text;namespace interfaceDemo{ //多重传送委托指一个委托类同时引用两个以上的方法,,实现多重委托在声明时返回值必须为void 类型的 public delegate void Option(int i,i...原创 2010-05-20 22:17:02 · 382 阅读 · 0 评论 -
C# 委托的定义、实例化、调用
using System;using System.Collections.Generic;using System.Text;namespace interfaceDemo{ //委托的定义 // [访问修饰符] delegate 数据类型 委托名(参数列表....) //1、定义委托 //2.委托的实例化 ...原创 2010-05-20 21:50:01 · 397 阅读 · 0 评论 -
C# 使用索引器
using System;using System.Collections.Generic;using System.Text;//使用索引器namespace interfaceDemo{ public class Photo//相片类 { string title; public Photo(string titl...原创 2010-05-16 00:15:32 · 148 阅读 · 0 评论 -
C# 定义索引器
using System;using System.Collections.Generic;using System.Text;//定义索引器//索引器允许类或结构的实例按照与数组相同的方式进行索引。索引器类似于属性,//不同之处在与他们的访问器采用的是参数//索引器允许类或结构的实例像数组一样进行索引。//类似于属性,在定义的时候采用get和set方法...原创 2010-05-16 00:14:32 · 179 阅读 · 0 评论 -
C# 枚举的定义及其简单运用
using System;using System.Collections.Generic;using System.Text;//枚举的定义及其简单运用namespace interfaceDemo{ //枚举定义一组特定值的数据类型,第一个值如果没有定义则默认为0,依次递增 //如果定义了某个特定的值,则自动加1,在默认情况下,枚举中的每个元素类型都是i...原创 2010-05-16 00:13:28 · 158 阅读 · 0 评论 -
C# 显示接口调用
using System;using System.Collections.Generic;using System.Text;//显示接口实现namespace interfaceDemo{ public interface InterfaceA { void MethodA();//抽象方法 void Method...原创 2010-05-12 22:17:45 · 407 阅读 · 0 评论 -
C# 通过接口实现多重继承
using System;using System.Collections.Generic;using System.Text;//通过接口实现多重继承namespace interfaceDemo{ class Person {//定义实体类 internal int age; internal string name; ...原创 2010-05-12 21:59:48 · 1382 阅读 · 2 评论 -
C# 接口的声明和实现
using System;using System.Collections.Generic;using System.Text;namespace interfaceDemo{ interface Switch { //定义接口 //两个抽象方法 void turnOn(); void turnOff();...原创 2010-05-06 23:03:49 · 1017 阅读 · 0 评论 -
c# 机构的使用
using System;using System.Collections.Generic;using System.Text;namespace Queue{ public struct Point//定义结构 { public int x; public int y; //结构中无法定义参数的构造...原创 2010-05-06 22:44:54 · 113 阅读 · 0 评论 -
c# 结构的定义
using System;using System.Collections.Generic;using System.Text;namespace Queue{ public struct Animal {//定义接口 public int legs; public string name; public st...原创 2010-05-06 22:30:43 · 413 阅读 · 0 评论 -
C# HashTable 应用
using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace Queue{ class HashTableTest { static void Main(string[] args) {...2010-05-03 18:19:06 · 133 阅读 · 0 评论 -
C# 集合对象ArrayList
using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace Queue{ class TestArrayList { static void Main(string[] args) { ...2010-05-03 17:57:47 · 194 阅读 · 0 评论 -
C# 冒泡排序
using System;using System.Collections.Generic;using System.Text;namespace BubbleSortTest{ class BubbleSortTest { public static void Sort(int[] array) { ...2010-05-03 17:38:16 · 100 阅读 · 0 评论 -
数组运用之 队列
using System;using System.Collections.Generic;using System.Text;namespace Queue{ class QueueTest//队列类 { int[] array; int length = 0;//保存元素个数,初始化为0 public...2010-05-03 17:23:10 · 99 阅读 · 0 评论 -
List<T> 泛型集合
using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace DicrionaryTest{ //泛型集合 class Class3 { static void Main(string[] a...原创 2010-05-22 23:53:42 · 128 阅读 · 0 评论