Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/11/2009, 10:28
Avatar de vistas
vistas
 
Fecha de Ingreso: julio-2007
Mensajes: 3
Antigüedad: 16 años, 9 meses
Puntos: 0
ERROR!!! java might not have been initialized

Hola soy novato en java y estoy realizando una pequeña agenda, tengo una duda creo que este error me dice que mis variables b, c, d, no estan inicilizadas pero creo segun yo ya las declare, no se que pase si alguin me podria explicar se los agradecere. les dejo el codigo

Agenda1App.java:23: variable b might not have been initialized
System.out.println("Nombre:\t" + b);
^
Agenda1App.java:24: variable c might not have been initialized
System.out.println("Direccion:\t" + c);
^
Agenda1App.java:25: variable d might not have been initialized
System.out.println("Telefono:\t" + d);

import java.io.*;
import java.util.Scanner;
public class Agenda1App{
public static void main (String args[])throws Exception {
int a;
String b, c;
int d;

Scanner ley = new Scanner(System.in);
System.out.println("\t\t\tPROGRAMA DE AGENDA\n\n");
System.out.println("Cuantas personas quieres ingresar:\t" );
a = ley.nextInt();
for(int i=0; i<=a; i++){
System.out.println("Nombre:\t");
b = ley.next();
System.out.println("Direccion:\t");
c = ley.next();
System.out.println("Telefono:\t");
d = ley.nextInt();
}

for(int i=0; i<=a; i++)
{
System.out.println("Nombre:\t" + b);
System.out.println("Direccion:\t" + c);
System.out.println("Telefono:\t" + d);
}
}
}