Thursday, December 3, 2009

My own web server

This may sound trivial for my geeky friends.. but it was a great thing for me... :)
I set up a web server on my laptop yesterday night hoping to listen to my personal collection of songs from elsewhere... :P
Here is a good web resource. Give it a shot!!
Getting to learn a lot from my friends these days... so hoping to be actively blogging... :)Hope this continues....

Tuesday, December 1, 2009

comparable or comparator

Comparable or Comparator which of these interfaces to use and when; I had been thinking hard on this for quite sometime and had a discussion with a friend of mine on it..
Well here s the tip: use Comparator Interface when instances of your class can be compared in more than one way, else go with Comparable interface. For eg. Employees of a company can be compared by their name, age, salary, etc... So you could define a comparator for each of these criterions and pass it to the static sort method of ArrayList.
Refer http://onjava.com/onjava/2003/03/12/java_comp.html for more clarity.