title: How to specify a variable as an argument?
body: <p>I'm a beginner to Java, I have been instructed to carry out the following:</p>
  
  <ul>
  <li>Create a new class <code>Food</code></li>
  <li>The name of the food specified as an argument.</li>
  <li>A getter method for the name of the food.</li>
  </ul>
  
  <p>My attempt looks like:</p>
  
  <pre><code>public class Food 
  {
      String food;    
  
      Food() {
          food = "";
      }
      public String getFood() {
          return food;
      }
  }
  </code></pre>
  
  <p>Would I the name of food be specified as an argument be changed to:</p>
  
  <pre><code>Food(String food) {
      food = "";
  }
  </code></pre>
  
  <p>Or any different way? Thanks.</p>