Use Chinese programming in Java

xiaoxiao2021-04-09  396

The Java source program supports Unicode, you can use the text of Chinese or other countries to program. Just watching the "Let us use Chinese Programming" in the Dancefire blog, just to discuss this problem with friends before, and use Java tried Implement the C # program of Dancefire.

The source program is as follows:

Package com.pclib.www;

Public Class Biology {Public String Name = "Biology";

Public void self-introduction () {system.out.println ("I am ... 咦? What are I? I don't know what I am, anyway, I am a" name);}

Public string getName () {return name;}

Public static void main (String args []) {bird bird = new bird (); fish fish = new fish (); horse = new horse (); animal animal = new animal (); biological organism = new creature () Bird. Self-introduction (); bird. Mobile (); fish. Self-introduction (); fish. Mobile (); horse. Self-introduction (); horse. Mobile (); animal. Self-introduction (); animal. Mobile (); Biology. Self-introduction ();}}

Class Animal Extends Biology {Protected String Mobile Way;

Protected string quantifier = "only";

Public animal () {name = "animal"; mobile mode = "move";

Public string getName () {return name;}

Public void mobile () {system.out.println ("This" measurement name "in free" mobile mode "/ n");}

Public void self-introduction () {system.out.println ("I belongs to" getname () ", I am a" measure word "cute" getName ());}}

Class bird extends animal {public bird () {name = "bird"; mobile mode = "flying";

Public string getname () {return name;}}

Class fish extends animal {public fish () {name = "fish"; mobile mode = "Tour to swim"; quantifier = "strip";}

Public string getname () {return name;}}

Class Horse Extends Animal {PUBLIC Horse () {Name = "Ma"; Mobile Way = "Run"; Quantifier = "Match";

Public string getname () {return name;}}

Dancefire Article Address: http://blog.9cbs.net/dancefire/archive/2004/104/124805.aspx? Pending = true

转载请注明原文地址:https://www.9cbs.com/read-133182.html

New Post(0)