✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
public class Fruit { int price = 10; public int getPrice() { return price; }}
public class Apple extends Fruit { @Override public int getPrice() { return super.getPrice() * 3 + super.getPrice(); }}
public class Main { public static void main(String[] args) { Fruit fruit = new Fruit(); Apple firstApple = new Apple(); Apple secondApple = new Apple(); System.out.println(fruit.getPrice() + firstApple.getPrice() + secondApple.getPrice()); }}
Mis on programmi väljund?
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!