![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#面向对象学习笔记
meifage2
这个作者很懒,什么都没留下…
展开
-
面向对象概念
面向对象概念(*)原创 2011-06-20 08:15:00 · 336 阅读 · 0 评论 -
索引器
public string this[int index]{get {return ""; }set { }} using System;using System.Collections.Generic;using System.Text;namespace 索引{ class Program {原创 2011-06-20 16:37:00 · 353 阅读 · 0 评论 -
const常量
常量const常量。常量名要大写。原创 2011-06-20 14:59:00 · 429 阅读 · 0 评论 -
构造函数
原创 2011-06-20 11:36:00 · 355 阅读 · 0 评论 -
.net反编译器
~解决方案/项目名/bin/Debug/项目名.exe拖到.net反编译器中即可查看类似源码原创 2011-06-20 10:56:00 · 377 阅读 · 0 评论 -
成员访问级别
原创 2011-06-20 08:59:00 · 429 阅读 · 0 评论 -
namespace
namespace,解决类重名问题,就是文件夹。using,引入其他类。 使用.net的类System.Collections.ArrayList快速引入的方法,右键→解析。 using System;using System.Collections.Generic;using System.Text;using 命名空间.hr;using System.原创 2011-06-20 16:10:00 · 371 阅读 · 0 评论 -
static
原创 2011-06-20 15:46:00 · 352 阅读 · 0 评论 -
异常与异常处理
原创 2011-06-20 14:50:00 · 352 阅读 · 0 评论 -
对象的引用
i1=3;i2=i1;i1++;与p1=new Person();p2=p1;p1.i++;原创 2011-06-20 11:17:00 · 349 阅读 · 0 评论 -
定义类
class Person{ } 定义字段:class Person{public string Name;public int Age;public void SayHello(){Console.WriteLine("你好,我是{0}",Name);}}初始化对象,调用方法:Person tom = new Person();tom.Name="tom";tom.SayHello();原创 2011-06-20 08:41:00 · 495 阅读 · 0 评论 -
继承
1、public class Chinese:Person{public string HuKou{get;set;}public void KongFu(){....}}Chinese p1 = new Chinese();p1.Name="李雷";p1.HuKou="北京市朝阳区";p1.SayHello();p1.KongFu(); 2、定义类的时候不指定父类,则是Object类。原创 2011-06-20 13:53:00 · 336 阅读 · 0 评论 -
属性
属性惯用法:属性开头字母大写,字段开头字母小写class Person{private int age;public int Age{get{return age;}set{age=value;}}public void SayHello(){Console.WriteLine("我的年龄是{0}",Age);}} 自动实现的属性(C# 编程指南)(3.0以上才有的功能)class Ligh原创 2011-06-20 09:40:00 · 335 阅读 · 0 评论