Created
October 28, 2015 14:29
-
-
Save AnnaBoro/7f7a131c8a88cd166d11 to your computer and use it in GitHub Desktop.
lesson4-Car+EnumColor
This file contains hidden or 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 lesson4; | |
/** | |
* Created by anna on 28.10.15. | |
*/ | |
public class Car1 { | |
private String name; | |
private String ownerName; | |
private int capacity; | |
private int maxSpeed; | |
private boolean isFull; | |
private Color1 color; | |
public Car1() { | |
} | |
public void paintCar() { | |
setColor(color.BLACK); | |
System.out.println("Car painted in " + getColor()); | |
} | |
public void runCar() { | |
System.out.println("Car runs"); | |
} | |
public void stopCar() { | |
System.out.println("Car stops"); | |
} | |
public void turnCar() { | |
System.out.println("Car turns"); | |
} | |
public String getName() { | |
return name; | |
} | |
public String getOwnerName() { | |
return ownerName; | |
} | |
public int getCapacity() { | |
return capacity; | |
} | |
public boolean isFull() { | |
return isFull; | |
} | |
public int getMaxSpeed() { | |
return maxSpeed; | |
} | |
public Color1 getColor() { | |
return color; | |
} | |
public void setColor(Color1 color) { | |
this.color = color; | |
} | |
public void setOwnerName(String ownerName) { | |
this.ownerName = ownerName; | |
} | |
public void setIsFull(boolean isFull) { | |
this.isFull = isFull; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment