/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package humano;
import java.util.Scanner;
/**
*
* @author GATO
*/
public class Humano {
/**
* @param args the command line arguments
*/
String Nombre, Apellido;
int Edad;
public Humano ()
{
Scanner teclado = new Scanner(System.in);
System.out.print("Ingrese el nombre: ");
this.Nombre = teclado.nextLine();
System.out.print("Ingrese el apellido: ");
this.Apellido = teclado.nextLine();
System.out.print("Ingrese la edad:");
this.Edad= teclado.nextInt();
}
public void MuestraNombre(){
System.out.println(Nombre);
System.out.println(Apellido);
System.out.println(Edad);
}
public static void main(String[] args) {
// TODO code application logic here
Humano hl=new Humano();
hl.MuestraNombre();
}
}
No hay comentarios:
Publicar un comentario