Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package Lamlai;
- import java.io.Serializable;
- import java.util.Scanner;
- /**
- *
- * @author leo
- */
- public class Student implements Serializable {
- private String ten, tuoi;
- public Student() {
- }
- public Student(String ten, String tuoi) {
- this.ten = ten;
- this.tuoi = tuoi;
- }
- public String getTen() {
- return ten;
- }
- public void setTen(String ten) {
- this.ten = ten;
- }
- public String getTuoi() {
- return tuoi;
- }
- public void setTuoi(String tuoi) {
- this.tuoi = tuoi;
- }
- public void nhap() {
- Scanner s = new Scanner(System.in);
- System.out.print("Nhap ten: ");
- setTen(s.nextLine());
- System.out.print("Nhap tuoi: ");
- setTuoi(s.nextLine());
- }
- public void hienthi() {
- System.out.println("Ten: " + getTen());
- System.out.println("Tuoi: " + getTuoi());
- System.out.println("*****************");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment