Java Collections lastIndexOfSubList() MethodThe lastIndexOfSubList() method of Java Collections class is used to get the starting position of the last occurrence of the specified target list within the specified source list. It returns -1 if there is no such occurrence in the specified list. SyntaxFollowing is the declaration of lastIndexOfSubList() method: Parameter
ReturnsThe lastIndexOfSubList() method returns the starting position of the last occurrence of the specified target list within the specified source list, or -1 if there is no such occurrence. ExceptionsNA Compatibility VersionJava 1.4 and above Example 1Test it NowOutput: Target Output: 2 Example 2Test it NowOutput: Target Output: -1 Example 3Test it NowOutput: List :[kitu, mani, raj, karthi, rahul, gagan] Last IndexOfSubList: 3 Next TopicJava Collections Class |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India