title: How to populate a formatted String using an Array List
body: <p>I am looking to format a String using an ArrayList which Strings, and integers within it. I can populate the same formatted String using an array. However this is not very useful because an Array can not contain both a String and an int. After creating an array list I found that my string will not be populated, unlike the case with an array. What are my options?</p>
  
  <p><strong>Array</strong></p>
  
  <pre><code>import java.util.List;
  import java.util.ArrayList;
  
  
  public class HelloWorld{
  
       public static void main(String []args){
          String name = "Varun";
          String description = "cool";
          String [] string_array = new String[2];
          string_array[0] = name;
          string_array[1] = description;
          String works = String.format("Hi my name is %s and I am %s",string_array);
          System.out.println(works);
       }
  }
  </code></pre>
  
  <p><strong>Array List</strong></p>
  
  <pre><code>import java.util.List;
  import java.util.ArrayList;
  
  
  public class HelloWorld{
  
       public static void main(String []args){
          String name = "Varun";
          int age = 22;
          List &lt;Object&gt; string_list = new ArrayList&lt;Object&gt;();
          string_list.add(name);
          string_list.add(age);
          String works = String.format("Hi my name is %s and I am %d years old",string_list);
          System.out.println(works);
       }
  }
  </code></pre>
  
  <p><strong>How can I get my String to be formatted working using an ArrayList</strong></p>