// This import declaration binds the prefix `io` to the `ballerina/io` module.
// The prefix by default comes form the last part of the module name.
// The `ballerina` org name is reserved for the standard library modules.
import ballerina/io;
// `main` function is the program entry point.
// `public` makes function visible outside the module.
public function main() {
// Here `io:println` means function `println` is in the module bound to prefix `io`.
io:println("Hello, World!");
}
Programs and modulesEvery Ballerina program consists of modules. Modules are one or more |
import ballerina/io;
This import declaration binds the prefix io
to the ballerina/io
module.
The prefix by default comes form the last part of the module name.
The ballerina
org name is reserved for the standard library modules.
public function main() {
main
function is the program entry point.
public
makes function visible outside the module.
io:println("Hello, World!");
Here io:println
means function println
is in the module bound to prefix io
.
}
bal run programs_and_modules.bal
Hello, World!