I have a full name: Jais Pereira Guedes Godofredo
The example below, I get the last word, but how to print with this result: Godofredo, Jais Pereira Guedes
public class Aula1{
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String nomeCompleto = "Jais Pereira Guedes Godofredo";
String[] split = nomeCompleto.split(" ");
String resultado = split[split.length - 1];
System.out.println(resultado );
}
}