Advertisement
Nickolay35

Artifact

Nov 18th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. public class Artifact {
  2. public static void main(String[] args) {
  3.  
  4. Artifact art1 = new Artifact(211221);
  5. Artifact art2 = new Artifact(321342, " Ацтеки");
  6. Artifact art3 = new Artifact(123421," Древний Рим ", 13);
  7.  
  8. System.out.println("Серийный номер " + art1.number);
  9. System.out.println("Серийный номер " + art2.number + " Цивилизация " + art2.cult);
  10. System.out.println("Серийный номер " + art3.number + " Цивилизация " + art3.cult + " Дата создания " + art3.date);
  11.  
  12. }
  13.  
  14.  
  15. int number;
  16. String cult;
  17. int date;
  18.  
  19. public Artifact(int number) {
  20. this.number = number;
  21. }
  22.  
  23.  
  24.  
  25. public Artifact(int number, String cult) {
  26. this.number = number;
  27. this.cult = cult;
  28. }
  29.  
  30. public Artifact(int number, String cult, int date) {
  31. this.number = number;
  32. this.cult = cult;
  33. this.date = date;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement