当前位置:网站首页>C # illustrated tutorial (Fourth Edition) chapter7-7.2 accessing inherited members
C # illustrated tutorial (Fourth Edition) chapter7-7.2 accessing inherited members
2022-06-13 02:19:00 【Python's path to becoming a God】
using System;
namespace IllustratedCSharp_Chapter7_72_AccessClassMember
{
class Program
{
static void Main(string[] args)
{
// Console.WriteLine("Hello World!");
OtherClass oc = new OtherClass();
oc.Method1(oc.Field1);
oc.Method1(oc.Field2);
oc.Method2(oc.Field1);
oc.Method2(oc.Field2);
}
}
class SomeClass
{
public string Field1 = "base class field";
public void Method1(string value) {
Console.WriteLine("Base class --Method1: {0}",value);
}
}
class OtherClass : SomeClass
{
public string Field2 = "derived class field";
public void Method2(string value)
{
Console.WriteLine("Derived class -- Method2: {0}", value);
}
}
}
边栏推荐
- 华为设备配置私网IP路由FRR
- [pytorch] kaggle large image dataset data analysis + visualization
- STM32 external interrupt Usage Summary
- Ruixing coffee moves towards "national consumption"
- Easydl related documents and codes
- The commercial value of Kwai is being seen by more and more brands and businesses
- Armv8-m learning notes - getting started
- Looking at Qianxin's "wild prospect" of network security from the 2021 annual performance report
- 0- blog notes guide directory (all)
- [unity] problems encountered in packaging webgl project and their solutions
猜你喜欢
SQLserver2008 拒绝了对对象 '****' (数据库 '****',架构 'dbo')的 SELECT 权限
Understanding and thinking about multi-core consistency
Cumulative tax law: calculate how much tax you have paid in a year
Stm32+ze-08 formaldehyde sensor tutorial
[work with notes] NDK compiles the open source library ffmpeg
Chapter7-11_ Deep Learning for Question Answering (2/2)
Mbedtls migration experience
Leetcode 473. 火柴拼正方形 [暴力+剪枝]
[pytorch]fixmatch code explanation (super detailed)
Thesis reading - autovc: zero shot voice style transfer with only autoencoder loss
随机推荐
Vivo released originos ocean, and the domestic customized system is getting better and better
Application circuit and understanding of BAT54C as power supply protection
Armv8-m (Cortex-M) TrustZone summary and introduction
[learning notes] xr872 GUI littlevgl 8.0 migration (file system)
[work with notes] NDK compiles the open source library ffmpeg
Huawei equipment is configured with CE dual attribution
Cumulative tax law: calculate how much tax you have paid in a year
STM32F103 IIC OLED program migration complete engineering code
About the fact that I gave up the course of "Guyue private room course ROS manipulator development from introduction to actual combat" halfway
1000 fans ~
传感器:SHT30温湿度传感器检测环境温湿度实验(底部附代码)
Basic exercises of test questions letter graphics ※
STM32 external interrupt Usage Summary
The fastest empty string comparison method C code
C language compressed string is saved to binary file, and the compressed string is read from binary file and decompressed.
[open source] libinimini: a minimalist ini parsing library for single chip computers
Solution of depth learning for 3D anisotropic images
Area of basic exercise circle ※
(novice to) detailed tutorial on machine / in-depth learning with colab from scratch
Chapter7-10_ Deep Learning for Question Answering (1/2)