This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.persistence.*; | |
@Entity | |
@Table(name = "apartment") | |
public class Apartment { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
@Column(name = "id") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Apartment { | |
private double district; | |
private String address; | |
private double square; | |
private int rooms; | |
private double price; | |
public Apartment(double area, String address, double square, int rooms, double price) { | |
this.district = area; | |
this.address = address; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Lesson_9_10.Lesson_9.Task_1; | |
public interface Entity <ID> { | |
ID getID(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Lesson_7_8.Lesson_7.Task_3; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.function.Predicate; | |
public class Filter { | |
static <T> List<T> filter(List<T> list, Predicate<T> predicate) { | |
List<T> tofilter = new ArrayList<>(); | |
for (T elem : list) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Lesson_7_8.Lesson_7.Task_2; | |
public class ComparablePair<T extends Comparable<? super T>> { | |
private T t1; | |
private T t2; | |
public ComparablePair(T t1, T t2) { | |
this.t1 = t1; | |
this.t2 = t2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Lesson_7_8.Lesson_7.Task_1; | |
import java.util.ArrayList; | |
import java.util.Comparator; | |
import java.util.List; | |
public class Max { | |
static <T> T max(List<T> list, Comparator<T> comparator) { | |
list.sort(comparator); | |
return list.get(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Lesson_5_6.Task1_AirlineTicket; | |
public class Baggage { | |
private int bagquant; | |
private double bagprice; | |
public Baggage(int bagquant, double bagprice) { | |
this.bagquant = bagquant; | |
this.bagprice = bagprice; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Project_one; | |
abstract class BaseuserInfo { | |
public String name; | |
private String surname; | |
private String number; | |
public BaseuserInfo(String name, String surname, String number) { | |
this.name = name; | |
this.surname = surname; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Lesson_3_4.Lesson_3_Task_2; | |
import java.util.Arrays; | |
public class HallForSession { | |
private int row; | |
private int place; | |
private int hallnumber; | |
private static String FREE = "Free"; | |
private static String BOOKED = "Boked"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Lesson_3_4.Lesson_3_Task_1; | |
public class AudioContent { | |
private byte [] content; | |
public AudioContent (byte[]content){ | |
this.content = content; | |
} | |
public byte[] getContent(){ |