how to convert a double to long in java code example Example: java double to long long num = Double.valueOf(d).longValue()