What is different type of lastIndexOf method in String java example

What is different type of lastIndexOf() method in String java example


public class Test {
        public static void main(String[] args) {       
            String st = new String("test string test here");
           
            int index = st.lastIndexOf((int)'t');
            System.out.println(index);
           
            index = st.lastIndexOf((int)'t', 5);
            System.out.println(index);
           
            index = st.lastIndexOf("test");
            System.out.println(index);
           
            index = st.lastIndexOf("test", 10);
            System.out.println(index);
        }
}

Comments

Recent Post

Recent Posts Widget

Popular posts from this blog

Capture image from webcam java code, examples

How to capture finger prints in java

Shallow Copy Deep Copy Java example