title: need to JSON output?
body: <p>Here i'm creating one product list in java. I need product list as JSON. How to do this ?</p>
  
  <pre><code>private List&lt;ProductFromServiceTemp&gt; getListFromWebservice() 
      {
  
          List&lt;ProductFromServiceTemp&gt; productList = new ArrayList&lt;ProductFromServiceTemp&gt;();
          for(int i = 0; i &lt; 10; i++)
          {
              ProductFromServiceTemp product = new ProductFromServiceTemp();
              product.setName("name " + i);
              product.setDescription("desc " + i);
              product.setPrice(i * 100d);
              productList.add(product);
              System.out.println("Product = " + product);
              System.out.println("productList = " + productList);
          }
  
          return productList;
      }
  </code></pre>
  
  <p>So now it like this </p>
  
  <pre><code>`Array ar = [prod1, prod2];`
  </code></pre>
  
  <p>then </p>
  
  <pre><code>ar[i].name
  ar[i].price
  </code></pre>
  
  <p>how to get the product detail? please any one help me.</p>