Skip to content

Instantly share code, notes, and snippets.

@ballerina-github-bot
Created October 17, 2020 10:24
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 ballerina-github-bot/6ac47293007155000d390a2f75cb1625 to your computer and use it in GitHub Desktop.
Save ballerina-github-bot/6ac47293007155000d390a2f75cb1625 to your computer and use it in GitHub Desktop.
Ballerina Playground
// This example imports a module. You can only refer to the public symbols of
// an imported module.
import ballerina/math;
// Declare an explicit alias.
import ballerina/io as console;
public function main() {
// Refer symbols of another module.
// `math:PI` is a qualified identifier. Note the usage of the module alias.
float piValue = math:PI;
// Use the explicit alias `console` to invoke a function defined in the `ballerina/io` module.
console:println(piValue);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment