Advertisement
nguyenvanquan7826

SinhVien

May 14th, 2013
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Sinh_Vien
  4. {
  5.     private String MaSV, HoTen;
  6.    
  7.     public class Date
  8.     {
  9.         public int m,d,y;
  10.        
  11.         public void setDate(int d, int m, int y)
  12.         {
  13.             this.m=m;
  14.             this.y=y;
  15.             this.d=d;
  16.         }
  17.         public String showDate()
  18.         {
  19.         //System.out.print(" "+d+"/"+m+"/"+y+" ");
  20.         return " "+d+"/"+m+"/"+y+" ";
  21.         }
  22.    
  23.     }
  24.    
  25.     public void input()
  26.     {
  27.         Scanner scan=new Scanner(System.in);
  28.         Date D = new Date();
  29.         MaSV=scan.nextLine();
  30.         HoTen=scan.nextLine();
  31.         int d,m,y;
  32.         d=scan.nextInt();
  33.         m=scan.nextInt();
  34.         y=scan.nextInt();
  35.         D.setDate(d,m,y);
  36.         scan.close();
  37.    
  38.     }
  39.    
  40.     public void info()
  41.     {
  42.         Date D = new Date();
  43.         D.setDate(4, 5, 2013);
  44.         System.out.print(MaSV+"\t"+HoTen+"\t"+D.showDate());
  45.     }
  46.     public static void main(String []Srg)
  47.     {
  48.         Sinh_Vien sv = new Sinh_Vien();
  49.         sv.input();
  50.         sv.info();
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement