Convert byte value to mega byte value


public class Main {

  public static void main(String args[]) {
    long l = 9999999990L;
    long MEGABYTE = 1024L * 1024L;
    long b = l / MEGABYTE;
    System.out.println(b + " Mb");
  }

}
Home 
  Java Book 
    Runnable examples  

Data Type Long:
  1. Create Long from long value
  2. Convert Long to numeric primitive data types
  3. Convert Long to String
  4. Convert byte value to mega byte value
  5. Min and Max values of datatype long