title: Can I access a subclass object's properties through a superclass reference in Java?
body: <p>Let's say I have a class called Food and in the constructor it has attributes for price, # of calories, and a description.</p>
  
  <p>I also have a subclass of Food called Burger, and the Burger has an additional attribute for type of meat.</p>
  
  <p>Now if I create an array of Food instances that contains instances of the Burger class, can I access the type of meat attribute through the array?</p>
  
  <p>Sorry if this is confusing, but I want to know if I can (and how) I can access parent and child properties in an array of parent and child objects. I am using Java too.</p>