Escolar Documentos
Profissional Documentos
Cultura Documentos
<%--
Document : index
Created on : 15/08/2017, 08:44:05 AM
Author : Estudiante_PC
--%>
</body>
</html>
-----------------------------------------------------------------------------------
---------------
Informacion
<%--
Document : infromacion
Created on : 15/08/2017, 09:41:33 AM
Author : Estudiante_PC
--%>
}catch(NumberFormatException ex){
out.print("<script type=text/javascript>");//Envia mensaje de error
al no ingresar numeros en la casilla edad
out.print("alert('Formato incorrecto');");
out.print("location.href='index.jsp';");
out.print("</script>");
Persona
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package modelo;
/**
*
* @author Estudiante_PC
*/
public class Persona {
public Persona() {
nombre = " ";//variable nombre,vacia para poder ingresar cualquier dato
edad = 0;
}
/**
* @return the nombre
*/
public String getNombre() {//encapsulamos nombre y edad
return nombre;
}
/**
* @param nombre the nombre to set
*/
public void setNombre(String nombre) {
this.nombre = nombre;
}
/**
* @return the edad
*/
public int getEdad() {
return edad;
}
/**
* @param edad the edad to set
*/
public void setEdad(int edad) {
this.edad = edad;
}
}