moviegenre.java
来自「绝对经典!好动西和大家一起分享 呵呵 你们不应该如此限制的,不好」· Java 代码 · 共 30 行
JAVA
30 行
/* MovieGenre - very simple helper class * Copyright 2001, Bruce E. Wampler */public class MovieGenre{ private static String[] values = { "Drama", "Comedy", "Children", "Family", "Action", "Sci-Fi", "Documentary", "Other" }; public static int indexOf(String str) { for (int ix = 0 ; ix < values.length ; ++ix) if (values[ix].equals(str)) return ix; return 0; } public static String stringAt(int at) { if (at < 0 || at >= values.length) return "Other"; return values[at]; } public static String[] getNames() { return values; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?