|
|
|
|
|
by carimura
2110 days ago
|
|
Maybe you're looking for String::formatted? Directly from http://openjdk.java.net/jeps/378: Another alternative involves the introduction of a new instance method, String::formatted, which could be used as follows:
String source = """
public void print(%s object) {
System.out.println(Objects.toString(object));
}
""".formatted(type);
|
|