Confusing myself about why swimming Pegasus needs to be abstract. It thought an abstract class would be generally further up the chain eg an animal instead of a horse.
Swimming Pegasus seems very specific to be something that's abstract.
package com.codegym.task.task12.task1231;
/*
Useless abstractions
*/
public class Solution {
public static void main(String[] args) {
Horse horse = new Pegasus();
horse.run();
}
public static interface CanFly {
public void fly();
}
public static class Horse {
public void run() {
}
public void abstract swim() {}
}
public static class Pegasus extends Horse implements CanFly {
public void fly() {
}
}
public static class SwimmingPegasus extends Pegasus {
public void swim();
}
}