package com.kk;
class Auto {
public int tyre;
public double weight;
public String color;
public double speed;
public double accelerate(double up){
speed+=up;
return speed;
}
/*方法*/
public double slow(double down){
speed-=down;
return speed;
}
public double stop(){
speed=0;
return speed;
}
/*两种构造方法*/
public Auto(int tire,double weight,String colour,double speed) {
this.tyre =tire;
this.weight =weight;
this.color =colour;
this.speed =speed;
}
public Auto() {
}
}
public class Test {
public static void main(String[] args) {
Auto smallcar=new Auto();