class CDesplazar
{
  private String texto;
  private int tamaño;

  public void leerTexto()
  {
    System.out.print("Introduce un texto: ");
    texto = Leer.dato();
    tamaño = texto.length();            
  }
 
  public void mostrarTexto()
  {
    System.out.println(texto);            
  }
 
  public void desplazarUnCaracter()
  {
    int i=0;
    char ultimo;
    // Convertir el String en una matriz de caracteres
    char[] cadChar = texto.toCharArray();

    ultimo = cadChar[tamaño-1];

    // Desplazar el texto una posición a la derecha. El último
    // pasa a ser el primero.
    for(i = 0; i < tamaño-1; i++)
      cadChar[tamaño-(i+1)] = cadChar[tamaño-(i+2)];
     
    cadChar[0] = ultimo;
    // Convertir la matriz de caracteres en un String
    texto = new String(cadChar);
  }
 
  public int numCars()
  {
    return tamaño;
  }
}
