i wrote this code for checking
free memory ,allocated memory ,max memory ,total free memory.
public class Memory
static Scanner consloe=new Scanner (System.in);
public static void main(Stringargs)
Runtime runtime = Runtime.getRuntime();
long maxMemory = runtime.maxMemory();
long allocatedMemory = runtime.totalMemory();
long freeMemory = runtime.freeMemory();
System.out.println("free memory: " + freeMemory / 1024);
System.out.println("allocated memory: " + allocatedMemory / 1024);
System.out.println("max memory: " + maxMemory /1024);
System.out.println("total free memory: " +
(freeMemory + (maxMemory - allocatedMemory)) / 1024);
i don't know if it's correct or not??
this is the question
Write a program in a language(java) of your choice that can test and check how much memory is installed in your computer.