Last active
August 31, 2021 12:11
-
-
Save minte9/eb7c9002d68fbdf35d7a8ec8ce8afe35 to your computer and use it in GitHub Desktop.
Java / OOP / Static - https://www.minte9.com/java/oop-introduction-static-1184
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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