You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have any problem with these codes, please leave a question at here or you can contact message my messager
Lưu ý:(Cách đọc git:>)
Mỗi folder bên trên (tên Chủ đề con Code.ptit) là một package đều thuộc 1 Source Package trong cùng 1 Project Java
Mỗi bài là 1 file .java
Những commit ngày đầu trông đần hơn=)) sau sẽ sửa dần
Lưu ý:(Khi code😢)
Tên file phải chuẩn theo yêu cầu đề bài (ex: "Data.in" != "DATA.in" ) dù IDE vẫn tìm thấy file nhưng code.ptit thì không :v
Khởi tạo 1 đối tượng nên nhập từ Scanner (ex: public SinhVien(Scanner sc){ } )
Khi tạo String mã đối tượng(ex: mã SV: B20DCAT010), nên dùng String.format (ex: "B20DCAT"+String.format("%03d",stt) )
Khi tạo ngày, nên sài Date(ex: Trong class SinhVien, dùng Date birthday)
nếu cần chuẩn hóa: new SimpleDateFormat("dd/MM/yyyy").parse(yourString)
và cần in ra thì: new SimpleDateFormat("dd/MM/yyyy").format(this.birthday)
Khi in 1 đối tượng, nên tạo phương thức toString và return String.format("%s %s %d %.1f ....",this.,..)
Trong thực tế, nên làm 1 bài trong 1 package, và trong đó gồm nhiều file java class khác nhau,
làm kiểu này sẽ thực tế hơn với hướng đối tượng, nhưng khi nộp thì cần nén package thành file zip và nộp lên, nên khá mất thời gian.
Ở đây mình ghi hết các class vào 1 file có main:> cho dễ nộp bài