Chào các bạn! Vì nhiều lý do từ nay Truyen2U chính thức đổi tên là Truyen247.Pro. Mong các bạn tiếp tục ủng hộ truy cập tên miền mới này nhé! Mãi yêu... ♥

MyDate

import javax.swing.JOptionPane;

public class MyDate {

public int Date;

public int Month;

public int Year;

/*phuong thuc Set */

public void setDate( int Date){

this.Date=Date;

}

public void setMonth(int Month){

this.Month=Month;

}

public void setYear(int Year){

this.Year=Year;

}

/* Phuong Thuc Get */

public int getDate(){

return Date;

}

public int getMonth(){

return Month;

}

public int getYear(){

return Year;

}

public void Nhap(){

Date=Integer.parseInt(JOptionPane.showInputDialog("Nhap Ngay:"));

Month=Integer.parseInt(JOptionPane.showInputDialog("Nhap Thang:"));

Year=Integer.parseInt(JOptionPane.showInputDialog("Nhap Nam:"));

}

public void Show( ){

JOptionPane.showMessageDialog(null,+Date+"/"+Month+"/"+Year);

}

public static void main(String[] args){

MyDate d = new MyDate();

d.Nhap();

d.Show();

}

}

Bạn đang đọc truyện trên: Truyen247.Pro