Here you can find the source of singularPlural(int n, String singular, String plural)
public static String singularPlural(int n, String singular, String plural)
//package com.java2s; //License from project: Apache License public class Main { public static String singularPlural(int n, String singular, String plural) { if (n < 0) { throw new IllegalArgumentException("n = " + n + " < 0"); }/*from w w w .j a v a 2 s . c om*/ return n + " " + (n <= 1 ? singular : plural); } }