Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    private static final Runtime RUNTIME = Runtime.getRuntime();

    static int getMaximumMemory() {
        long maxMem = RUNTIME.maxMemory();

        if (maxMem > Integer.MAX_VALUE) {
            return Integer.MAX_VALUE;
        }

        return (int) maxMem;
    }
}