In this article, we will see how to use char at method of String class in Java.
In Java, Strings, we can use char at method to return char acter in given index value.
Lets look to our code.
String x = "abc";
System.out.println(x.char at(3));
Lets see it in an example.
In above example, we created two String object. We used char at method to return char acter in the string as 3rd index item. Method returned "r" in "andromeda".