Aqui tenemos un conjunto de metodos que nos ayudan a ingresar datos en JAVA aunque los podemos utilizar en cualquier lenguaje estan creados para juncionar en JAVA
Si nos ponemos a analizar estos metoso encotramos que estos metodos hacen uso de otros metodos propios del lenguanje JAVA como System.out.print();
int LeeInt(String msg)throws IOException{
int aux;
System.out.print(msg+"\t"+":");
aux=Integer.parseInt(buf.readLine());
return aux;
}
Si nos ponemos a analizar estos metoso encotramos que estos metodos hacen uso de otros metodos propios del lenguanje JAVA como System.out.print();
int LeeInt(String msg)throws IOException{
int aux;
System.out.print(msg+"\t"+":");
aux=Integer.parseInt(buf.readLine());
return aux;
}
double LeeDou(String msg)throws IOException{
double aux;
System.out.print(msg+"\t"+":");
aux=Double.parseDouble(buf.readLine());
return aux;
}
String LeeStr(String msg)throws IOException{
String aux;
System.out.print(msg+"\t"+":");
aux=(buf.readLine());
return aux;
}
boolean LeeBool(String msg)throws IOException{
boolean aux;
System.out.print(msg+"\t"+":");
aux=Boolean.parseBoolean(buf.readLine());
return aux;
}
short LeeSho(String msg)throws IOException{
short aux;
System.out.print(msg+"\t"+":");
aux=Short.parseShort(buf.readLine());
return aux;
}
long LeeLon(String msg)throws IOException{
long aux;
System.out.print(msg+"\t"+":");
aux=Long.parseLong(buf.readLine());
return aux;
}
byte LeeByt(String msg)throws IOException{
byte aux;
System.out.print(msg+"\t"+":");
aux=Byte.parseByte(buf.readLine());
return aux;
}
void Imp(String msg, boolean ln){
if(ln)System.out.println(msg);
else System.out.print(msg);
}