Make slices

Report a typo

You have an outer class Apple and method cutApple in it. Inside cutApple create a local inner class Knife.
And in the class Knife create a method makeSlices.

This method should learn the variety of an apple (Gala in our example) and print:

Apple Gala is ready to be eaten!
Write a program in Java 17
class Apple {

private String appleVariety;

public Apple(String appleVariety) {
this.appleVariety = appleVariety;
}

void cutApple() {

// create local inner class Knife
// create method makeSlices()


Knife knife = new Knife();
knife.makeSlices();
}

public static void main(String[] args) {
Apple apple = new Apple("Gala");
apple.cutApple();
}
}
___

Create a free account to access the full topic