Využij poslední šanci na bezkonkurenční akci a už se nikdy nemusíš bát.
Zjisti víc
00
dny
00
hod.
00
min.
Thread.startVirtualThread(() -> {
System.out.println("Hello from a virtual thread!");
});record Shape(String type) {}var shape = new Shape("Rectangle");if (shape instanceof Shape(String typeOfShape)) {
System.out.println("Shape is of type " + typeOfShape);
}String description = switch (shape) {
case Shape(String type) -> "Shape type: " + type;
default -> "Unknown shape";
};var employee = new Employee("Bob", new Address("New York", "USA"));
if (employee instanceof Employee(String name, Address(String city, String country))) {
System.out.println(name + " lives in " + city + ", " + country);
}