Answers for "write variable inside string in java"

2

java variable in string

String string = String.format("A string %s", aVariable);
Posted by: Guest on September-08-2020
0

java use variables inside strings

Java 15+
String foo = "foo";
String bar = "bar";

String str = "First %s, then %s".formatted(foo, bar);
Posted by: Guest on June-05-2021

Code answers related to "write variable inside string in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language