Answers for "java adding long and int"

1

java double to long

long num = Double.valueOf(d).longValue()
Posted by: Guest on August-24-2020
2

java cast duration to long

Duration d = Duration.ofHours(1); 	// 1 hour with java.time
long millis = d.toMillis();			// 1 hour in milliseconds
Posted by: Guest on March-20-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language