Java Finding a sub string in string

indexOf(String str) return int value that is the index value of str if found in string other wise it returns -1.The index value start from 0.
contains(CharSequence str) returns boolean value if str is present in given string it will return true else false.