Skip to content

Instantly share code, notes, and snippets.

Avatar

ballerina-github-bot

View GitHub Profile
View play.bal
import ballerina/io;
public function main() {
io:println("Hello Ballerina!");
}
View play.bal
import ballerina/io;
type Student record {
string firstName;
string lastName;
int intakeYear;
float gpa;
};
public function main() {
Student s1 = { firstName: "Michelle", lastName: "Sadler", intakeYear: 1990,
gpa: 3.5 };
View play.bal
import ballerina/io;
public function main() {
io:println("Hello Ballerina!");
}
View play.bal
import ballerina/io;
public function main() {
io:println("Hello Ballerina!");
}
View play.bal
import ballerina/io;
public function main() {
io:println("Hello Ballerina!");
}
View play.bal
import ballerina/io;
// The constant `LKA` is marked as deprecated using the `@deprecated` annotation.
// Since it has documentation, the `# # Deprecated` documentation needs to be added as well.
// This will appear in the generated documentation.
# Country code for Sri Lanka.
# # Deprecated
# This constant is deprecated. Use the constant `LK` instead.
@deprecated
public const string LKA = "LKA";
View play.bal
import ballerina/io;
public function main() {
io:println(3.435e10);
}
View play.bal
import ballerina/io;
public function main() {
io:println("Hello Ballerina!");
}
View play.bal
import ballerina/io;
public function main() {
io:println("Hello Ballerina!");
}
View play.bal
// 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.
You can’t perform that action at this time.