Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * This method converts the hours in milliseconds.<br>
     * @param hours {@link Integer} to convert in milliseconds.
     * @return {@link Long} number representing the milliseconds of hours given.
     * @throws IllegalArgumentException {@link Exception} if argument given is less of zero.
     */
    public static long getMillisecondFromHours(int hours) throws IllegalArgumentException {
        if (hours < 0)
            throw new IllegalArgumentException("Hours given can not be less of zero.");

        return hours * 1000 * 60 * 60;
    }
}