Ah. subList() , didn't know about that one. docs say it takes two arguments - wonder what'd happen if passed only one?
It won't compile, but I guess you've already found that out by now.
Hopefully Java would imply "...to the last element inclusive"
It would be extremely dangerous to have a computer language that attempted to imply stuff when you pass in the wrong number of arguments, how does it know you haven't just forgotten to type the missing argument. Some languages allow optional arguments but that is different as the code is documented to say what happens in those cases.
If the writers of the library thought it was reasonable to imply "to the end" then there would be a single argument method as there is for substring() in the
String class. They didn't so I'm afraid you will have to supply both arguments.