How insert (a) and (b) in string line in java?
string a = "David";
string b= "Mike";
Console.WriteLine("This is test for {0} and {1}",a,b);
How insert (a) and (b) in string line in java?
string a = "David";
string b= "Mike";
Console.WriteLine("This is test for {0} and {1}",a,b);
You are looking for something called "String Interpolation". Since Java 5 you can use this:
String s = String.format("This is test for %s and %s", a, b);