Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Interfaces in Java Interfaces in Java Interfaces Quiz

please I need help on the interface in Java

Fill in the blank to create an Array that can contain both Wine and Cheese:

public class Main { public static void main(String[] args) { Wine wine = new Wine(); Cheese cheese = new Cheese(); --Object[ ]--- foods = {wine, cheese}; } }

class Wine implements Drinkable, Delicious { //omitted }

class Cheese extends Dairy implements Delicious { // omitted }

Did you ever receive an answer to this? I am getting it wrong as well

1 Answer

Fill in the blank to create an Array that can contain both Wine and Cheese:

public class Main { public static void main(String[] args) { Wine wine = new Wine(); Cheese cheese = new Cheese(); --Object[ ]--- foods = {wine, cheese}; } }

class Wine implements Drinkable, Delicious { //omitted }

class Cheese extends Dairy implements Delicious { // omitted }