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 属性
    }
    }

  • 相关阅读:
    JSP EL表达式
    JSP 核心标签库
    windows查看占用端口的进程
    JSP 自定义标签
    JSON-LD
    Java 国际化
    Java Web的两种开发模式
    CSS 图片加载完成再淡入显示
    Windows 让cmd启动的程序在后台运行
    Maven使用
  • 原文地址:https://www.cnblogs.com/zeromaiko/p/4379009.html
Copyright © 2011-2022 走看看