Skip to content

Commit

Permalink
2. Модель данных;
Browse files Browse the repository at this point in the history
  • Loading branch information
Temzor committed Nov 28, 2023
1 parent 1b840eb commit a67c211
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/ru/j4j/pojo/College.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package ru.j4j.pojo;

import java.util.Date;

public class College {
public static void main(String[] args) {
Student student = new Student();
student.setSurname("Libovsky");
student.setGroup(1814);
student.setStatStudy(new Date());

System.out.printf("Student: %s, Group: %s, Start of study: %s", student.getSurname(),
student.getGroup(), student.getStatStudy());
}
}
43 changes: 43 additions & 0 deletions src/main/java/ru/j4j/pojo/License.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package ru.j4j.pojo;

import java.util.Date;

public class License {
private String owner;
private String model;
private String code;
private Date created;

public String getOwner() {
return owner;
}

public void setOwner(String owner) {
this.owner = owner;
}

public String getModel() {
return model;
}

public void setModel(String model) {
this.model = model;
}

public String getCode() {
return code;
}

public void setCode(String code) {
this.code = code;
}

public Date getCreated() {
return created;
}

public void setCreated(Date created) {
this.created = created;
}
}

15 changes: 15 additions & 0 deletions src/main/java/ru/j4j/pojo/Police.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package ru.j4j.pojo;

import java.util.Date;

public class Police {
public static void main(String[] args) {
License license = new License();
license.setOwner("Dmitrii Kapustin");
license.setModel("Cadillac");
license.setCode("x111xx");
license.setCreated(new Date());

System.out.println(license.getOwner() + " has a car - " + license.getModel() + " : " + license.getCode());
}
}
33 changes: 33 additions & 0 deletions src/main/java/ru/j4j/pojo/Student.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package ru.j4j.pojo;

import java.util.Date;

public class Student {
private String surname;
private int group;
private Date statStudy;

public String getSurname() {
return surname;
}

public void setSurname(String surname) {
this.surname = surname;
}

public int getGroup() {
return group;
}

public void setGroup(int group) {
this.group = group;
}

public Date getStatStudy() {
return statStudy;
}

public void setStatStudy(Date statStudy) {
this.statStudy = statStudy;
}
}

0 comments on commit a67c211

Please sign in to comment.