/* * [Jersey.java] * * Summary: Demonstrate implementing a simple Interface. * * Copyright: (c) 2009-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2009-04-11 initial version */ package com.mindprod.example; /** * Demonstrate implementing a simple Interface. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2009-04-11 initial version * @since 2009-04-11 */ class Jersey implements Cow { /** * breed of cow this class handles. */ private static final String BREED = "Jersey"; /** * Name of the breed * * @return Short string describing the breed. */ public String breedName() { return BREED; } /** * percentage butterfat of the milk * * @return percentage */ public double butterfat() { return 6.0; } /** * Typical milk production of this breed. * * @return daily milk production in litres */ public double milkProduction() { return 23.5; } // even though the methods implement an implicitly public method in the interface, you need the public keyword }