title: Function in Java similar to printf from C
body: <p>I want to create my own custom function in Java which work exactly same  like the <code>printf</code> in C.</p>
  <p>Like</p>
  <pre><code>printf(&quot;My name is %c, my age is %d&quot;, &quot;B&quot;, 23);
  </code></pre>
  <p>Which will print <code>My name is B, my age is 23</code></p>
  <p>or</p>
  <pre><code> printf(&quot;No of items %d&quot;, 2);
  </code></pre>
  <p>which will print <code>No of items 2</code>.</p>