inheritance.curry
来自「编译原理课程设计之pp2语法分析程序」· CURRY 代码 · 共 42 行
CURRY
42 行
class Animal { int height; Animal mother; void InitAnimal(int h, Animal mom) { height = h; mother = mom; } int GetHeight() { return height; } Animal GetMom() { return mother; }}class Cow extends Animal { bool isSpotted; void InitCow(int h, Animal m, bool spot) { isSpotted = spot; InitAnimal(h,m); } bool IsSpottedCow() { return isSpotted; }}void main() { Cow betsy; Animal b; betsy = New(Cow); betsy.InitCow(5, null, true); b = betsy; b.GetMom();}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?