Question: Can someone tell me whats a java method similar to the python's format method where I could replace a variable ?holder in a string with my own ones?

for instance:

```
    t1 = "test"
    t2 = "example"
    "This is a {0} test {1}".format(t1, t2)

```

Thanks

Answer: 
From Javadoc: <http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html>

```
   // Explicit argument indices may be used to re-order output.
   formatter.format("%4$2s %3$2s %2$2s %1$2s", "a", "b", "c", "d")
   // -> " d  c  b  a"

```

What does `%4$2s` mean?

* %: The start of Format String
* 4$: The 4th argument
* 2: Width of 2
* s: String
You could use the [`MessageFormat`](http://docs.oracle.com/javase/7/docs/api/java/text/MessageFormat.html) class for that, but a far easier and less verbose way would to just use this code:

```
"This is a " + t1 + " test " + t2

```

If you need good formatting capabilities, you can use `String.format`:

```
String.format("This is a %s test %s", t1, t2);

```