Hey guys can someone please help me!
this is what the assignment want from me
1. Create an abstract base class, Ball. the single constructor requires a
String to indicate the type of ball, which then is stored in an instance variable. The instance method getType(), returns a new String containing the type of ball. the class declares an abstract method play() which returns void
2. Create an abstract class Bounceable which inherits from Ball. Bouncealbe has a single abstract method, bounce() which returns a String there are no instance varibles
3. create 2 concrete classes Baseball and Bowlingball which inherit from Ball. No instance variables or additional methods are required only implementation of any inherited abstract methods
4. create 2 concrete classes Tennisball and Basketball which inherit from Bounceable. No instance variables or additonal methods are required only implementation of any inherited abstract methods
The class PolyTest source code they gave me
Here is all my classes
These are the errors
PolyTest.java: void type not allowed here
system.out.println("Ball #" +(i+1)+ "is a "+ball[i].getType());
Basketball.java: Basketball is not an abstract and does not override abstract method bounce() in Bounceable
public class Basketball extends Bounceable
Basketball.java: bounce() in Basketball cannot override bounce() in Bounceable; attempting to use incompatible return type
found: java.lang.string
required: void
public String bounce()
Basketball.java: Cannot find symbol
symbol: Constructor Bounceable(java.lang.string)
location: class Bounceable
super("Basketball");
Tennisball.java: Tennisball is not an abstract and does not override abstract method bounce() in Bounceable
public class Tennisball extends Bounceable
Tennisball.java: bounce() in Tennisball cannot override bounce() in Bounceable; attepmting to use incompatible return type
found: java.lang.string
required: void
public String bounce()
Tennisball.java: Cannot find symbol
Symbol: Constructor Bounceable(java.lang.string)
Location: class Bounceable
super("Tennisball");
Please tell me what I'm doing wrong