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 java.util.ArrayList; | |
public class RectangleRunner { | |
public static void main(String[] args) | |
{ | |
Rectangle rectangle = new Rectangle(10,15); | |
Rectangle rectangle1 = new Rectangle(10,3); | |
Rectangle rectangle2 = new Rectangle(5,6); |
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 Line { | |
private final Point start; | |
private final Point end; | |
public Line(Point start,Point end){ | |
this.start = new Point(start.getX(),start.getY()); | |
this.end = new Point(end.getX(),end.getY()); | |
} | |
public double getLength(){ |
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 task2; | |
/** | |
* Created by andrew on 26.01.17. | |
*/ | |
public class Point { | |
private final double x; | |
private final double y; | |
public Point(double x , double y){ |
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 Line { | |
private final Point start; | |
private final Point end; | |
public Line(Point start,Point end){ | |
this.start = start; | |
this.end = end; | |
} | |
public double getLength(){ |
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 Book { | |
private int id; | |
private String name; | |
private String author; | |
private String publisher; | |
private int yearofpublication; | |
private int numberOfPages; | |
private double price; | |
private String type; |
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 Animal { | |
protected String name; | |
protected int age; | |
protected double weight; | |
protected double height; | |
public Animal(String name, int age,double weight,double height) { | |
this.name = name; |
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 FamilyTariff implements TaxiTarrif { | |
@Override | |
public long calculatePrice(TaxiRide ride){ | |
return 50+20*ride.getDistance()/ride.getPassengers(); | |
} | |
} |
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 interface Data { | |
public int getsize(); | |
public String toString(); | |
} |
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 Film; | |
/** | |
* Created by andrew on 10.02.17. | |
*/ | |
public class Actor { | |
private String name; | |
public Actor(String name) { |
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 compare.NamesComparing; | |
import java.util.*; | |
/** | |
* Created by andrew on 17.02.17. | |
*/ | |
public class Names { |
OlderNewer