Groovy supports string interpolation operations. Here is an example
def name = "Tom"
println("Hello my name is ${name}")
Does Java 8 support string interpolation as the way Groovy does?
Any answer, greatly appreciated. Thanks
Java8 has nothing to do with this. For formatted console output, you can use printf() or the format() method of System.out Try this out.
System.out.printf("My name is: %s%n", "Tom");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With