fromTheSprawl, on 11 September 2012 - 11:06 PM, said:
Hey there. Once you extend an abstract class you need to write the implementation for those abstract methods which have no implementation on the abstract class. Those that have an implementation on the abstract class can be left as is. You can override them too, if you like.
ArrayLists can change size according to your need. They grow bigger and bigger and you can put in stuff at an ArrayList without thinking about declaring a new array with a new size just to add another element.
By the way by storing Strings and longs do you mean different objects in one collection? Yes, it is possible but you must find something that binds them together, like a similar Interface or class, in this case, the Object class. It would be tricky to print them though in one go.
Others, any thoughts?
ArrayLists can change size according to your need. They grow bigger and bigger and you can put in stuff at an ArrayList without thinking about declaring a new array with a new size just to add another element.
By the way by storing Strings and longs do you mean different objects in one collection? Yes, it is possible but you must find something that binds them together, like a similar Interface or class, in this case, the Object class. It would be tricky to print them though in one go.
Others, any thoughts?
I see, so if I extend an abstract class, I only have to implement the method if hasn't been done so already, and if I implement an interface, I have to implement all methods in that interface because interfaces can only declare methods.







MultiQuote



|