Created
October 17, 2020 10:24
-
-
Save ballerina-github-bot/6ac47293007155000d390a2f75cb1625 to your computer and use it in GitHub Desktop.
Ballerina Playground
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
// 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