You can do something like this:
public class Example
{
public String name;
public String location;
public String[] getExample()
{
String ar[] = new String[2];
ar[0]= name;
ar[1] = location;
return ar; //returning two values at once
}
}