Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/04/2006, 13:26
dark_night
 
Fecha de Ingreso: octubre-2004
Ubicación: chile
Mensajes: 116
Antigüedad: 19 años, 7 meses
Puntos: 0
problema de ingreso de datos

hola tengo el siguiente problema...tengo esta funcion k me retorna un tipo de dato segun la letra k se lee en pantalla

Código PHP:
public static String tipodato(int tipoint)
{
             
char tipo=' ';                
    
tipo=(char)tipoint;                                
    if(
tipo=='i')            
        return 
"int";
    else if(
tipo=='c')
        return 
"char";
    else if(
tipo=='b')
        return 
"boolean";
    return 
"String";

y la llamo desde aki
Código PHP:
System.out.println("Ingrese el nombre del atributo: ");
nombreatrbr.readLine();        
while(!
nombreatr.equals("#"))
{                        
    
System.out.println("Ingrese el tipo de atributo(s String, i int, c char, b boolean");
    
tipo=tipodato(System.in.read());
      
texto.println("private "+tipo+" "+nombreatr+";");
      
System.out.println("Ingrese el nombre del atributo: ");
    
nombreatrbr.readLine();

el problema k es k despues de ingresar el primer tipo de dato, se comiensa a saltar el ingreso de nombre...y solo me deja ingresar tipos....
komo arreglo para ke pueda seguir ingresando normalmente???

eso..gracias