[[TOC]]
List<String> list = new ArrayList<>();
list.add("Hello");
String str = list.get(0);
public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY
}
public void printNumbers(int... numbers) {
for (int number : numbers) {
System.out.println(number);
}
}
try (BufferedReader br = new BufferedReader(new FileReader("file.txt"))) {
System.out.println(br.readLine());
}
List<String> list = Arrays.asList("a", "b", "c");
list.forEach(item -> System.out.println(item));
@FunctionalInterface
interface MyFunctionalInterface {
void myMethod();
}
List<String> list = Arrays.asList("a", "b", "c");
list.stream().filter(s -> s.startsWith("a")).forEach(System.out::println);
Optional<String> optional = Optional.of("Hello");
optional.ifPresent(System.out::println);
LocalDate date = LocalDate.now();
LocalTime time = LocalTime.now();
LocalDateTime dateTime = LocalDateTime.now();
var list = new ArrayList<String>();
list.add("Hello");
public record Point(int x, int y) {}