Courses‎ > ‎AP Computer Science‎ > ‎Konstantinovich‎ > ‎notes‎ > ‎


posted Oct 30, 2017, 8:21 PM by Konstantinovich Samuel
Goal: Give in to your hatred... of Java. 

You cannot hide a public inherited method by making it private. 
-Since all derived classes are expected to function as the base class when storing them in variables, this is not allowed. 

Player has a public method attack()
Wizard extends Player. 

Player a = new Wizard();
a.attack();//Wizard cannot make this private, or it would break this functionality.

public class OrderedSuperArray extends SuperArray{

  /*constructor initializes an empty List*/
  public OrderedSuperArray(){
    //Complete this.

  /*call the proper add.*/
  public void add(int index, String value){

  /*Write this method and any
    appropriate helper methods.*/
  public boolean add(String value){
    //add to the correct spot.
    //you may still use super.add(index,value)
    return true;