title: How to create a variable from another class object
body: <p>I have two Java classes, Product and ProductReview. ProductReview has in addition to variables long id and String review a variable named Product that should contain an object from the class Product. Example:</p>
  
  <pre><code>@Entity
  @Table(name="Product Reviews")
  public class ProductReview implements java.io.Serializable {
  
  @Id
  @Column
  private long id;
  
  @Column
  private String review;
  
  private (stuck here, how do I type another classes object as a variable?)
  </code></pre>
  
  <p>The Product class has private variables long id, String name and List reviews (which also takes the reviews from ProductReviews class). Product class has a one-to-many association to ProductReviews and vice versa.</p>
  
  <p>So my question is: What is the correct syntax for creating the third variable in the example above? The variable should be an instance of a Product-object.</p>