Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Car {
- private String carid;
- private int speedcar, userup;
- public String getCarid() {
- return carid;
- }
- public void setCarid(String carid) {
- this.carid = carid;
- }
- public int getSpeedcar() {
- return speedcar;
- }
- public int getUserup() {
- return userup;
- }
- public void setUserup(int userup) {
- this.userup = userup;
- }
- public String show() {
- String ss = "the speed car is: " + (speedcar = 60);
- return ss;
- }
- public String speedup() {
- String up = "the speed car now is: " + (speedcar + userup);
- return up;
- }
- public String speeddown() {
- String d = "the speed car after slow is: " + (speedcar - 2);
- return d;
- }
- public String stop() {
- String s = "the car is stop and now the speed is: " + (speedcar = 0);
- return s;
- }
- public String ka(){
- String ci= "the number of car is: "+(carid)+"\n";
- return ci;
- }
- }
Add Comment
Please, Sign In to add comment