can anyone throw some light on why is removeRange(int fromIndex, int toIndex)
in Java Vector is protected?
Syntax -
protected synchronized void removeRange(int fromIndex, int toIndex)
I have studies a few blogs and did some code to understand but things are not really clear here. I have looked inside Vector.java and tried to create some understanding as well. But my overall perception is that removeRange(int fromIndex, int toIndex)
will eventually get removed.
I felt sublist(int fromIndex, int toIndex).clear()
is capable of doing the same job. And looks more apt from implementation and usability point of view.
Please help in understanding if you have a better thought.