zoukankan      html  css  js  c++  java
  • 第三次

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;


    namespace ConsoleApplication2
    {
    class Program
    {
    public static void Change(int a1,ref int b1,out int c1)
    {
    a1 =1;
    b1 =2;
    c1 =3;
    }
    //必须要加上static

    static void Main(string[] args)
    {
    int a1 = 0;
    int b1 = 0;
    int c1;
    Change(a1,ref b1,out c1);
    Console.WriteLine("{0},{1},{2}",a1,b1,c1);//尝试ref和out


    A a = new A();
    B b = new B();
    a.print();
    b.print();//override

    MyClass my = new MyClass();
    /* my.MyProperty(){ set(1);
    get();这个不会不知道怎么弄- -!
    }*/
    Console.ReadLine();

    }
    }
    }
    public class A
    {
    public virtual void print()
    {
    Console.WriteLine("Parent Method");
    }
    }

    public class B : A
    {
    public override void print()
    {
    Console.WriteLine("Overriding child method");
    }
    }

    class MyClass
    {
    private int myProperty = 0; //存储属性的私有成员
    public int MyProperty //属性
    {
    get { return this.myProperty; } //get 属性
    set { this.myProperty = value; } //set 属性
    }
    }

  • 相关阅读:
    数据操作-apply函数族
    11.盛水最多的容器
    canvas绘图
    Nodejs事件监听模块
    http性能测试
    源码解读
    nodejs的一些概念
    http知识补充
    querystring处理参数小利器
    url网址解析的好帮手
  • 原文地址:https://www.cnblogs.com/zeromaiko/p/4379009.html
Copyright © 2011-2022 走看看