FormatPluralspublic class FormatPlurals extends Object Format a plural correctly, by hand. |
Methods Summary |
---|
public static void | main(java.lang.String[] argv)
report(0);
report(1);
report(2);
| public static void | report(int n)report -- using conditional operator
System.out.println("We used " + n + " item" + (n==1?"":"s"));
|
|