Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pl.edu.uwm.wmii.dorozkogrzegorz.Kolokwium;
- import java.time.LocalDate;
- public class PlikVideo extends Plik implements Cloneable
- {
- private String rozszerzenie;
- private LocalDate dataUtworzenia;
- public PlikVideo(String nazwa, Integer rozmiar, boolean czyDoZapisu, String rozszerzenie)
- {
- super(nazwa,rozmiar,czyDoZapisu);
- this.dataUtworzenia=LocalDate.now();
- setRozszerzenie(rozszerzenie);
- }
- public void setRozszerzenie(String rozszerzenie)
- {
- this.rozszerzenie = rozszerzenie;
- }
- public void setDataUtworzenia(int rok, int miesiac, int dzien)
- {
- this.dataUtworzenia=LocalDate.now();
- }
- public LocalDate getDataUtworzenia()
- {
- return dataUtworzenia;
- }
- public String getRozszerzenie()
- {
- return rozszerzenie;
- }
- public String toString()
- {
- return super.toString()+", data utworzenia: "+this.getDataUtworzenia()+", rozszerzenie: "+this.getRozszerzenie();
- }
- protected Object clone() throws CloneNotSupportedException
- {
- PlikVideo temp = new PlikVideo(this.getNazwa(), this.getRozmiar(), this.getczyDoZapisu(), this.getRozszerzenie());
- return temp;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement