- 博客(9)
- 资源 (3)
- 收藏
- 关注
转载 base关键字
1.base其实最大的使用地方在面相对性开发的多态性上,base可以完成创建派生类实例时调用其基类构造函数或者调用基类上已被其他方法重写的方法。例如:2.关于base调用基类构造函数public classA{publicA(){Console.WriteLine("Build A");}}public class B:A{
2016-08-30 10:56:38 409
原创 捕获异常及自定义异常类
捕获异常: try - catch 收尾工作: try - catch - throw 抛出异常: throw 语句自定义异常类
2016-08-30 10:20:53 663
原创 装箱和拆箱
主要内容: int n = 16; object obj = n;//装箱 Console.WriteLine (obj); int i =(int )obj;//拆箱 Console.WriteLine(i); //注意:装箱拆箱过程损失了程序的性能,尽量少用。
2016-08-29 15:08:03 344
原创 基类向下转换
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 基类___派生类__向下转换{ class Program { static void Main(string[] args) {
2016-08-27 14:18:20 435
原创 派生类有参构造函数的编程
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 派生类构造函数{ class Program { static void Main(string[] args) {
2016-08-26 16:49:11 586
原创 索引器访问离散字段(输出有点小问题 暂时还没找到错误。) “homephone”引号里面多打了个 空格键! 导致字符串不匹配
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 索引器访问离散字段{ class Program { static void Main(string[] args) {
2016-08-25 18:08:38 282 2
原创 索引器的使用
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 索引器{ class Program { static void Main(string[] args) {
2016-08-25 16:44:06 193
原创 数组的传递
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 数组在方法中的传递{ class Program { static void Main(string[] args) {
2016-08-25 10:14:58 384
原创 this 关键字的用法
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace this关键字{ class Time { private int hour; private int minute;
2016-08-25 09:29:58 280
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人