My query is because I want to ask the user to enter by keyboard the student's data, and then use the parameters entered to send them to the Student constructor. What is the way to do this?
Student.java
public class Alumno {
private String nom = "null";
private String ap = "null";
private String dni = "null";
private String tel = "null";
public Alumno(String nom,String ap, String dni, String tel){
this.nom = nom;
this.ap = ap;
this.dni = dni;
this.tel = tel;
}
public void mostrarAlum(){
System.out.println("Alumno: "+nom+" Apellido: "+ape+" DNI: "+dni+" Telefono: "+tel);
}
}
ExerciseModelObjects.java
package ejerciciomodelarobjetos;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
*
* @autor jorge
*/
public class EjercicioModelarObjetos {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
//TODO code application logic here
System.out.println("Ingresee los datos correspondientes:");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//System.out.print("Nombre:");
Alumno alu = new Alumno(nom, ap, dni, tel);
}
}