Check out example codes for "how to return the first character in an array from a method java". It will help you in understanding the concepts better.

Code Example 1

public String firstElement(String[] array)
{
      if (array.length >= 1)
      {
      return array[0];
      }
      else {
          return "";
      }
}

Code Example 2

var string = "freeCodecamp";

string.charAt(0); // Returns "f"

Learn ReactJs, React Native from akashmittal.com