It's not an error, it's a piece of advice -- and in this case, it's bad advice, since you're actually using the richer interface of LinkedList. I haven't used Sonar personally, but hopefully it has some way to turn off this warning for this line -- with a setting somewhere, or possibly using an annotation in the source (ugh).
Anyway, feel free to ignore it. This is a case where automatic style checking just makes more work (in fact, most of the time, automatic style checking just makes more work, but that's another discussion.)
It does indeed, except that by calling addFirst(), you're guaranteed to be calling an efficient operation. If you generalize to add(0,...) then you're implying that any List is Ok, when the truth is that anything but LinkedList will be inefficient. Using the more specific type is really more appropriate here, IMO.
Thanks for your reply. but my doubt is that by using addfirst() i am using more specific method and that is my requirement. if we can do the same thin with add(0,..) then what is the use of addFirst() and linkedlist?
Ernest already mentioned it: efficiency reasons. There are implementations of List (notably ArrayList) for which inserting an element at position 0 is an O(n) operation instead of O(1) (which it is for LinkedList).