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
Use [`java.util.MesssageFormat`](http://docs.oracle.com/javase/7/docs/api/java/text/MessageFormat.html)

```
int planet = 7;
String event = "a disturbance in the Force";

String result = MessageFormat.format(
    "At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.",
    planet, new Date(), event);

```