class indexOf{
public static void main(String args[]){
String str1=”Welcome”;
System.out.println(“Given String is “+str1);
System.out.println(“Index of element ‘l’ is =”+str1.indexOf(‘l’));
System.out.println(“Index of element ‘e’ id =”+str1.indexOf(‘e’));
System.out.println(“Index of next ‘e’ is =”+str1.lastIndexOf(‘e’));
}
}