public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String name = read("Name:", scanner);
String surname = read("Surname:", scanner);
Integer bYear = Integer.valueOf(read("BYear:", scanner));
System.out.println(name + surname + bYear);
}
private static String read(String alert, Scanner scanner) {
System.out.print(alert);
return scanner.nextLine();
}
private static void reDraw(Boolean condition, ImageView view, Double scaleX, Double scaleY, Double translateY, Button button, Consumer<Button>... consumers) {
if (condition) {
if (scaleX != null)
view.setScaleX(scaleX);
if (scaleY != null)
view.setScaleY(scaleY);
if (translateY != null)
view.setTranslateY(translateY);
}
if (consumers != null) {
for (Consumer<Button> consumer : consumers) {
consumer.accept(button);
}
}
}
reDraw(isLargeSize, media, 1.0, 1.0, 2.0,
btnFont,
o -> o.setPrefWidth(5.0),
o -> o.setFont(Font.getDefault())
);
Для Java недавно видел примеры кода где то на гитхабе.