📄 food.as
字号:
package zoo { // The Food class is the superclass of the various types of food that // pets eat. public class Food { // Tracks the number of calories this piece of food has private var calories:int; // This piece of food's human readable name private var name:String; // Constructor public function Food (initialCalories:int) { // Record the specified initial number of calories setCalories(initialCalories); } // Returns the number of calories this piece of food has public function getCalories ():int { return calories; } // Assigns the number of calories this piece of food has public function setCalories (newCalories:int):void { calories = newCalories; } // Returns this piece of food's human readable name public function getName ():String { return name; } // Assigns this piece of food's human readable name public function setName (newName:String):void { name = newName; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -