Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author Anh-Kool
- */
- public class Student {
- public String ten, tuoi, diachi;
- public Student() {
- }
- public Student(String ten, String tuoi, String diachi) {
- this.ten = ten;
- this.tuoi = tuoi;
- this.diachi = diachi;
- }
- 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 String getDiachi() {
- return diachi;
- }
- public void setDiachi(String diachi) {
- this.diachi = diachi;
- }
- public void nhap() {
- Scanner s;
- System.out.print("Nhap ten: ");
- s = new Scanner(System.in);
- ten = s.nextLine();
- System.out.print("Nhap tuoi: ");
- s = new Scanner(System.in);
- tuoi = s.nextLine();
- System.out.print("Nhap dia chi: ");
- s = new Scanner(System.in);
- diachi = s.nextLine();
- }
- public void hienthi() {
- System.out.println("Ten: " + ten);
- System.out.println("Tuoi: " + tuoi);
- System.out.println("Dia chi: " + diachi);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement