Last active
February 7, 2018 18:29
-
-
Save j0K3Afr4id/f6dcf8abcc5a977cc98b4492f10dd54b to your computer and use it in GitHub Desktop.
Javadoc example
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
/** | |
*This class implements some simple specifics of a car | |
*@author Khayam Amin | |
*@version 1.0 | |
*/ | |
public class Car { | |
private String brand; | |
private String colour; | |
private String type; | |
private int year; | |
private int mileage; | |
/** | |
*This constructs a car with a specified brand, colour, type, year and mileage. | |
*@param brand indicates the brand of the car. | |
*@param colour indicates the colour of the car. | |
*@param type indicates the type of the car (like suv, coupe, station wagon, luxury, etc.) | |
*@param year indicates the year of car production. | |
*@param mileage indicate the total mileage of the car. | |
*/ | |
public Car (String brand, int year, int milage) { | |
this.brand = brand; | |
this.year = year; | |
this.mileage = mileage; | |
} | |
/** | |
*this method returns the updated miles traveled by the car | |
*@return this car's mileage | |
*/ | |
public void drive (int miles) { | |
if (miles > 0) | |
mileage += miles; | |
} | |
/** | |
*this method returns the current mileage of this car | |
*@return this car's mileage | |
*/ | |
public int getMileage (int miles) { | |
return miles; | |
} | |
/** | |
*this method assings the brand of this car | |
*/ | |
public void brand (String brand) { | |
this.brand = brand; | |
} | |
/** | |
*this method assigns the current color of this car | |
*/ | |
public void colour (String brand) { | |
this.colour = colour; | |
} | |
/** | |
*this method assigns mileage of this car | |
*/ | |
public void type (String brand) { | |
this.type = type; | |
} | |
/** | |
*this method returns the the year of car production | |
*@return the year of production of the car | |
*/ | |
public int year (int year) { | |
return year; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment