Q:

Incompatible int to String (getLast() method)

I have a string array
 String[] names; 

lets say there are a given number of elements in the array
I would like to make a getLast method which returns a string
  public String getLast() {

    return names.length - 1; 

}

This gives me an error that it's incompatible.
How could I do this to return a string? 
Also the same with an add method 
 public void add(int index, String element){

I'm curious how this would work without using Linkedlist or Arraylist, but rather an Array-based list. 

A:

I think this is what you are looking for:
public String getLast(){
   return names[names.length-1];
}

[] is Array access by index.
If an array A has size 10, the last item is A[9].
That's because numbering always starts from 0.  
For the add method, you need to access the array element by the given index and substitute it's value:  
public void add(int index, String element){
   names[index] = element;
}  

A:

Get last element:
   public String getLast() {
        return names[names.length - 1];
      }

Add a String element to the array
    public void add(int index, String element) {
    int len = names.length;
    if (index < len)
      names[index] = element;
    else {
      names = Arrays.copyOf(names, len + (index - len + 1));
      names[index] = element;
    }
  }

