• + 0 comments

    my code:

    import java.io.; import java.util.;

    class bicycle { String text(){ return " with pedals.";

    }
    

    }

    class moto extends bicycle{ String text(){ return " an engine.";

    }
    moto(){
        System.out.println("Hello I am a motorcycle, I am a cycle with"+ text());
        String ss = super.text();
    
        System.out.println("My ancestor is a cycle who is a vehicle"+ ss);
    }
    

    }

    public class Solution {

    public static void main(String[] args) {
        moto bi = new moto();
    
    }
    

    }