Hola estoy haciendo en un main que se pida varios datos y luego trato con ellos.
 
Código:
   //Obtenemos el textoseparamos las letras guardadolas en un array letrastexto
   System.out.println("Introduce el texto a ser cifrado");
   Scanner entrada = new Scanner (System.in);
   String texto = entrada.nextLine();
   char [] letrastexto = new char[texto.length()];
   for(int i = 0; i<texto.length();i++){
       letrastexto[i] = texto.charAt(i);
    }
   
   //Obtenemos las claves y las guardamos en un array claves
   System.out.println("Introduce el numero de claves que va a utilizar (Ej: 2)");
   int numclaves = entrada.nextInt();
   int claves [] = new int [numclaves];
   for(int i = 0; i<numclaves; i++){
    System.out.println("Introduce la clave numero "+(i+1));
    claves[i] = entrada.nextInt();
    }
   
    //Obtenemos cifrado
   
    System.out.println("Introduce secuencia");
    String sec = entrada.nextLine();
    int [] secuencia = new int [sec.length()];
    for(int i = 0; i<sec.length();i++){
       secuencia[i] = texto.charAt(i);
    }
   
 }
  Compila y todo bien, se ejecutan todos los nextLine o nextInt excepto el ultimo.
A que puede ser esto debido? 
Saludos