here's a sample code I wrote,
public static void main(String []args){
String inputString = "apple";
char a = inputString[2]; //one
System.out.println(inputString[2]); //two
}
both one and two gives me an error saying Array type expected; found: 'java.lang.String'
what am I doing wrong? how do I access a specific index in a String?