Created
July 19, 2019 03:50
-
-
Save Harshal96/c7c9ee0490f48667e903c2974c9befbb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import static java.lang.Math.*; | |
| import static java.lang.System.out; | |
| public class StaticImports { | |
| public static void main(String[] args) { | |
| // no more System. ... | |
| out.println("Hello World!"); | |
| out.println("Considering a circle with a diameter of 5 cm, it has:"); | |
| // no more Math. ... | |
| out.println("A circumference of " + (PI * 5) + " cm"); | |
| out.println("And an area of " + (PI * pow(5, 2)) + " sq. cm"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment