Created
January 20, 2014 06:45
-
-
Save rayjcwu/8516000 to your computer and use it in GitHub Desktop.
You are teaching Java by way of geometry problems. Your work requires Math.PI, Math.cos, Math.sin and other Math package functions. You would prefer to simply use the simple names (e.g. PI, cos, sin) without the Math. or java.lang.Math. prefixes. How do you accomplish that? 1. Declare that GeometryLesson aliases java.lang.Math.
2. Declare that G…
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
class GeometryLesson { | |
static double degreesToRadians (double d) { | |
return (Math.PI / 360) * d; | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment