Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class plane {
- private String name;
- private int crew;
- private int year;
- public String getName(){
- return name;
- }
- public int getYear(){
- return year;
- }
- public int getCrew(){
- return crew;
- }
- public void setName(String name){
- this.name = name;
- }
- public void setYear(int year){
- this.year = year;
- }
- public void setCrew(int crew){
- this.crew = crew;
- }
- }
- public class Passenger extends plane{
- private int people_amount;
- private int people_max;
- Passenger(String name, int year, int crew, int people_amount,int people_max){
- setName(name);
- setYear(year);
- setCrew(crew);
- this.people_amount = people_amount;
- this.people_max = people_max;
- }
- int getPeople_amount(){
- return people_amount;
- }
- int getPeople_max(){
- return people_max;
- }
- }
- public class Cargo extends plane{
- private double load;
- private double max_load;
- Cargo(String name, int year, int crew,double load,double max_load){
- setName(name);
- setYear(year);
- setCrew(crew);
- this.load = load;
- this.max_load = max_load;
- };
- double getLoad(){
- return load;
- }
- double getMax_load(){
- return max_load;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement