Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.text.DecimalFormat;

public class Main {
    public static void main(String[] args) {
        DecimalFormat df = new DecimalFormat("0.00");

        long freeMem = Runtime.getRuntime().freeMemory();
        System.out.println(df.format(freeMem / 1000000F) + " MB");
    }
}