Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.HashSet;

import java.util.Set;

public class Main {
    public static <V> Set<V> newHashSet(int expectedSize) {
        return new HashSet<V>(expectedSizeToCapacity(expectedSize));
    }

    private static int expectedSizeToCapacity(int expectedSize) {
        return 4 * expectedSize / 3 + 1;
    }
}