This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm working on a exercise and got the following problem:
I wrot this Interface:
and I've implemented this interface in Class ListOne:
At this point, everything seems fine and okay
Next Step: I have to implement the a Class ListTow with an LinkedList instead of an ArrayList and of course I should reuse as much as possible code. I know that I have to refactor it :-), but what is now the approach? Should I create an abstract Class for ListOne and ListTwo or how should i proceed?
Thanks a lot for any hints
Ps: sorry for my bad english, but I'm not a native english speaker
If it works then it's a "Good Thing" however you should note that index based access of LinkedList elements are not as efficient as index based access of ArrayList elements, so your algorithms for the LinkedList based implementation will not be as performant. Iterator based algorithms might be better,
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter