Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: BSD License 

import java.util.Locale;

public class Main {
    private static String getUnits(int amount, String unitName, String unitNamePlural) {
        if (amount == 1)
            return String.format("1 %s", unitName);
        return String.format(Locale.getDefault(), "%d %s", amount, unitNamePlural);
    }
}