Create a class named Sandwich that contains the following data fields: MainIngredient - of type String Bread
Fantastic news! We've Found the answer you've been seeking!
Question:
- Create a class named Sandwich that contains the following data fields: MainIngredient - of type String Bread - of type String Price - of type Double Include get and set methods for these fields. The methods should be prefixed with 'get' or 'set' respectively, followed by the field name using camel case. For example, setMainIngredient. Use the application named TestSandwich that instantiates one Sandwich object and demonstrates the use of the set and get methods to test your class.
Related Book For
Posted Date: