@Acer And I don't think it's a good idea to call setFoodName in the constructor. Say you want to change the food name from "Tomato" to "StrangeRedApple", you have to rewrite every single function attribute.
I would simply set the member foodName to "Tomato", and every time you need the name, you do "this.foodName" or "getFoodName()"..