Saturday, 31 January 2015

Java collection framework

This article talks about the collection framework in Java. Interfaces and classes hierarchy for collections:


Tuesday, 20 January 2015

Comparable and Comparator

By default a collection is sorted in natural order: numbers and Strings are sorted in ascendant order. Note that for Strings upper-cases comes before lower-cases and spaces comes before any characters.You can modify the default behaviour of 'natural order' by implementing a 'Comparable' or/and 'Comparator' interfaces for your classes.

Sunday, 11 January 2015

The statements continue, break and label

In a loop:
  • continue: cease the current iteration and start the next one
  • break: stop the loop in which it is located
  • label: give an identifier to a loop in order to use it with continue or break statements