java round up double to max int code example Example: double round java integer int a = (int) Math.round(doubleVar);