Skip to content

Instantly share code, notes, and snippets.

@Harshal96
Created July 19, 2019 03:50
Show Gist options
  • Select an option

  • Save Harshal96/c7c9ee0490f48667e903c2974c9befbb to your computer and use it in GitHub Desktop.

Select an option

Save Harshal96/c7c9ee0490f48667e903c2974c9befbb to your computer and use it in GitHub Desktop.
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