The java string lastindexof() method returns last index of the given character value or substring. If it is not found, it returns -1. The index counter starts from zero.
There are 4 types of lastIndexOf method in java. The signature of lastIndexOf methods are given below:
ch :char value i.e. a single character e.g. 'a'
fromIndex :index position from where index of the char value or substring is retured
substring :substring to be searched in this string
last index of the string