Let's program in Chinese
I suddenly thought that C # should support Chinese programming, because it supports Unicode of source code, so I wrote a small program in Chinese to see if it can be compiled and executed. The result is exactly as expected, it can be executed. Although the Code has no practical value, it is very interesting. I want to use such a small program to teach a Chinese student to learn object-oriented, which may be lower and more interesting. After all, it is a mother tongue. (For a slight correction, you can use the runtime class identification to determine "who I am ")
The source code of the program is:
Using System;
Namespace Chinese programming
{
Public class creature
{
Public virtual void ()
{
Console. WriteLine ("I am... succeeded? What am I? I don't know what I am, but I am a "+ this. GetType (). Name );
}
}
Public class animal: creature
{
Protected string movement mode;
Protected string quantifiers = "only ";
Public animal ()
{
Mobile mode = "mobile ";
}
Public virtual void mobile ()
{
Console. WriteLine ("this" + quantizer + this. GetType (). Name + "at will" + mobile mode + Environment. NewLine );
}
Public override void ()
{
Console. writeLine ("I belong to" + this. getType (). baseType. name + ", I am a" + quantizer + "cute" + this. getType (). name );
}
}
Public class bird: Animal
{
Public bird ()
{
Moving Mode = "Flying ";
}
}
Public class fish: Animals
{
Public fish ()
{
Mobile mode = "traveling ";
Quantifiers = "entries ";
}
}
Public class horse: Animal
{
Public horse ()
{
Mobile mode = "running ";
Quantifiers = "horse ";
}
}
Run sealed public class
{
[STAThread]