Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jf-js opened this issue May 21, 2022 · 0 comments
Open

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

Jf-js opened this issue May 21, 2022 · 0 comments

Comments

@Jf-js
Copy link

Jf-js commented May 21, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant