Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static String ordinal(int num) {
        String[] suffix = { "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th" };
        int m = num % 100;
        return String.valueOf(num) + suffix[(m > 10 && m < 20) ? 0 : (m % 10)];
    }
}