摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace InterFaceTest{ //声明接口 public interface ISleep { void sleep(); } //实现接口 public class People : ISleep { public void sleep() { Console.WriteLine("人睡觉"); ... 阅读全文
posted @ 2012-11-13 17:22
菜鸟程序猿
阅读(157)
评论(0)
推荐(0)
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace abstractTest{ //只要一个方法声明为:abstract,类也必须使用abstract修饰,abstract修饰的类不能实例化 public abstract class Person { //声明SayHello抽象方法 public abstract void SayHello(); } public class Chinese : ... 阅读全文
posted @ 2012-11-13 16:59
菜鸟程序猿
阅读(186)
评论(0)
推荐(0)
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 继续{ public class Person { public string Name { get; set; } public int Age { get; set; } public virtual void SayHello() { Console.WriteLine("我的名字是:{0},年龄是{1}",Name,... 阅读全文
posted @ 2012-11-13 16:38
菜鸟程序猿
阅读(426)
评论(0)
推荐(0)
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 继续{ public class Person { public string Name { get; set; } public int Age { get; set; } public string language { get; set; } public virtual void SayHello() { ... 阅读全文
posted @ 2012-11-13 16:07
菜鸟程序猿
阅读(188)
评论(0)
推荐(0)

浙公网安备 33010602011771号