复件 slogan.java
来自「java源程序 对初学者有很大的帮助 从简单到复杂」· Java 代码 · 共 38 行
JAVA
38 行
//********************************************************************// Slogan.java Author: Lewis/Loftus//// Represents a single slogan string.//********************************************************************public class Slogan{ private String phrase; private static int count = 0; //----------------------------------------------------------------- // Sets up the slogan and counts the number of instances created. //----------------------------------------------------------------- public Slogan (String str) { phrase = str; count++; } //----------------------------------------------------------------- // Returns this slogan as a string. //----------------------------------------------------------------- public String toString() { return phrase; } //----------------------------------------------------------------- // Returns the number of instances of this class that have been // created. //----------------------------------------------------------------- public static int getCount () { return count; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?