The iterator on both lists
2)Why is the iteration of an ArrayList and LinkedList not the same speed (not complexity, actual speed)? Which one is most likely faster?
Iteration of my linkedlist appears to be quicker in speed, probably because the insert and remove operations give good performance O(1) in LinkedList compared to ArrayListO(n). Hence if there is a requirement of frequent addition and deletion in application then LinkedList is a best choice, which is why it might be faster.
3)Is the big-Oh complexity of the four main operations identical between the List types (add(), remove(), get() and set())?
The add and remove for the Arraylist has a time complexity of O(n), because the remaining elements in an array have to be shifted left or right, however the linkedlist has to traverse from node to node if its node is not at the front or back of the list, therefore at a worst case O(n) complexity.
The get and set for the Arraylist has a time complexity of O(1), as they can just access an element at the n'th spot, however the linkedlist has to traverse from node to node, therefore it has an O(n) complexity.
Unit Tests allow the coder to make big changes to code quickly. You then can instantly find out whether or not the code works through multiple scenarios through testing, it can also help you identify errors just as fast and hopefully get it up and runnig. In addition, unit tests help you really understand the design of the code you are working on. Instead of writing code to do just do something for one problem, you are starting by outlining all the conditions you are subjecting the code to (the contracts) and what outputs you'd expect from that.
This separation of the presentation and application logic is attractive to web developers because they can assemble a UI that leverages Java components without mastering the code for fetching and filling in the data. The code is also a lot easier to follow and read.
You can drag and drop UI components to a JavaFX Content pane, and the tool generates the FXML code that can be used in an IDE, so you dont have to code it.
The interface looks like this:
public interface Callback<P,R> {
public R call(P param);
}
We end up writing less code. No specialized interface, no default implementations.