Which lines of code would correctly set up an array of 5 Sandwich objects and create the first Sandwich object within the array? (We're pretending that we have already created a Sandwich "template"...



Which lines of code would correctly set up an array of 5 Sandwich objects and create the first Sandwich object within the array? (We're pretending that we have already created a Sandwich "template" class with a Constructor that takes zero parameters.)




























Sandwich[ ] sandwiches = new Sandwich[5];


Sandwich[0] = sandwiches;





Sandwich sandwiches = new Sandwich[5];


sandwiches[0] = new Sandwich();





Sandwich [ ] sandwiches = new Sandwich[5];


sandwiches[0] = new Sandwich();





Sandwich[5] = new sandwiches [ ];


Sandwich[0] = sandwiches;




in java



Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here