Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write the code that will declare a variable named \'myApple\' of class Apple. //

ID: 3864928 • Letter: W

Question

Write the code that will declare a variable named 'myApple' of class Apple.

//using this code

public class Fruit {

    private double pricePerPound;

    private String code;

    public Fruit(double pricePerPound, String code) {

        this.pricePerPound = pricePerPound;

        this.code = code;

    }

    public Fruit(String code) {

        this.code = code;

    }

}

public class Apple extends Fruit {   

private String variety;    

public Apple(double pricePerPound, String code, String variety) {   

}    

public Apple(String code) {   

}  

}

//the code should be in java

Explanation / Answer

}

}