package net.studyinghttp; class InheritanceTester2 { public static void main(String args[]) { Fruit apple = new Apple(); System.out.println(apple.color()); System.out.println(apple.color("codling")); System.out.println(apple.taste()); } } class Apple extends Fruit { String color (String type) { if (type.equals("codling")) { return "Green"; } else { return "Red"; } } String color () { return color("normal"); } String taste () { return "Sour"; } } abstract class Fruit { abstract String color(); abstract String color(String type); String taste () { return "Sweet"; } }