************************************************************************
COMPLETE SOURCE CODE FOR : GetIndexOfCharacterFromString.java
************************************************************************
public class GetIndexOfCharacterFromString
{
public static void main(String[]args)
{
//Create a String
String a="ABCD";
//Create an int variable that will store index for character C
int index=a.indexOf('C');
//Print index that we get
System.out.println("Index for C is : "+index);
}
}
************************************************************************
JUST COMPILE AND EXECUTE IT
************************************************************************