title: Java assigning values to arrays / objects
body: <p>I am converting to Java from Javascript (cause of university) and cannot seem to come around to the logic of array / object assignment. 
  What I'm trying to achieve is to have something like used to be in Pascal "record" with different variables. This then call in main class and create few instances of that. This is the simple structure I have for example:</p>
  
  <pre><code>class shoppingCart {
      public static void main(String[] args){
          // Define objects
          Product[] products = new Product[3];        
  
          // Fill in products
          products[0] = {
              title: "Product 1",
              code: "AB432",
              price: 13.60,
              quantity: "dozen"
          }                    
      }
  }
  
  class Product {
      public String title;
      public String code;
      public float price;
      public String quantity;
  }
  </code></pre>
  
  <p>Can someone please point me the right way how to create "records" and how to assign values to them? I had the same problem with array in Java before when I declared the variable (array) and later tried </p>
  
  <pre><code>someArray = {23,2,32,523}
  </code></pre>
  
  <p>and compiler gives me error... </p>