Skip to content

Exercise 2 - may be a lack of documentation - add method #34

@Jf-js

Description

@Jf-js

Hi,

This may be a small thing, still it made me confused for sometime.

Section : Exercise 2

In the file MyArrayList.java, stubs are given for four methods as listed below.
However in the text book, it has asked to implement only three methods, skipping add method.

There is no specific instruction given in the book, what to do with the stub given for add method.
Obviously everyone can assume that this has also to be implemented, for that purpose the code is
also given in the book. Therefore it is a matter of copy and paste, I did so.

Still it confused a bit while reading the book. The similar point is applicable to the file MyLinkedList.java as well.

public boolean add(T element) {}
public int indexOf(Object target) {}
public T remove(int index) {}
public T set(int index, T element) {}

MyLinkedList.java
public void add(int index, E element) {}
public int indexOf(Object target) {}
public E remove(int index) {}
public List subList(int fromIndex, int toIndex) {}

Franklin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions