An unordered collection of labelled items.
Traits
Homogenous? | No |
---|---|
Static/dynamic? | Static |
Mutable? | No |
Example
Usage
public record ExampleRecord(String name, int id, String message) {
}
public class Main {
public static void main(String[] args) {
ExampleRecord exampleRecord = new ExampleRecord("name", 1, "hi");
ExampleRecord exampleRecord2 = new ExampleRecord("other", 2, "bye");
System.out.println(exampleRecord);
System.out.println(exampleRecord2);
}
}
Info
Python does not natively implement records.