Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to return the first character in an array from a method java

public String firstElement(String[] array)
{
      if (array.length >= 1)
      {
      return array[0];
      }
      else {
          return "";
      }
}
 
PREVIOUS NEXT
Tagged: #return #character #array #method #java
ADD COMMENT
Topic
Name
4+9 =