Does Java 8 support interpolation
11,614
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");
Author by
Dan Smith
Updated on July 07, 2022Comments
-
Dan Smith almost 2 years
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
-
sh4d0w almost 6 yearsSo basically, no
-
Milan Velebit over 5 years@sh4d0w Should be the accepted answer really lol