OOP-Projects-Java

Log | Files | Refs | README

Cappuccino.java (765B)


      1 package coffee;
      2 
      3 public class Cappuccino implements Coffee {
      4 	private int energy;
      5 	private String type;
      6 
      7 	/**
      8 	 * Constructor of coffee class
      9 	 * 
     10 	 * @param energy Sets the energy of the coffee.
     11 	 */
     12 	public Cappuccino(int energy) {
     13 		this.energy = energy;
     14 		this.type = "Cappuccino";
     15 	}
     16 
     17 	/**
     18 	 * Get the energy of coffee
     19 	 * 
     20 	 * @return returns energy as integer.
     21 	 */
     22 	@Override
     23 	public int getEnergy() {
     24 		return this.energy;
     25 	}
     26 
     27 	/**
     28 	 * Set the energy of cofee object.
     29 	 * 
     30 	 * @param int energy sets the energy of coffee object.
     31 	 */
     32 	@Override
     33 	public void setEnergy(int energy) {
     34 		this.energy = energy;
     35 	}
     36 
     37 	/**
     38 	 * Return the type of coffee.
     39 	 * 
     40 	 * @return type The type of coffee.
     41 	 */
     42 	@Override
     43 	public String getType() {
     44 		return this.type;
     45 	}
     46 }