Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * This method returns the number of Seconds in a long time format.<br>
     * @param milliseconds {@link Long} long number representing a time
     * @return {@link Long} number of Seconds from millisecond given.
     * @throws IllegalArgumentException {@link Exception} if argument given is less of zero 
     */
    public static long getSecondsFromMillisecond(long milliseconds) throws IllegalArgumentException {
        if (milliseconds < 0)
            throw new IllegalArgumentException("Milliseconds given can not be less of zero.");

        return milliseconds / 1000;
    }
}