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: 
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);

```
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);

```