Skip to content

Instantly share code, notes, and snippets.

@minte9
Last active August 31, 2021 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minte9/eb7c9002d68fbdf35d7a8ec8ce8afe35 to your computer and use it in GitHub Desktop.
Save minte9/eb7c9002d68fbdf35d7a8ec8ce8afe35 to your computer and use it in GitHub Desktop.
/**
Define MyMath.floor() method using java.lang.math method
class App {
public static void main(String[] args) {
double n = MyMath.floor(12.3);
System.out.print(n); // 12.0
}
}
*/
// SOLUTION
class MyMath {
public static Double floor(Double no) {
return Math.floor(no);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment