summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKidhanis De Jesus <kidhanis@gmail.com>2017-06-08 13:29:56 -0400
committerven <vendethiel@hotmail.fr>2017-06-08 19:29:56 +0200
commit846abc4d9a6764c63fccd245b917b92f71cf00ce (patch)
treeb87dc2af985d01209d9c9faa7aed51dd6b4b6e44
parent0c1d3dc27a9b9186f480c81d19a7c34d468417dd (diff)
[en/java] Modify the Animal abstract class (#2751)
* Fix word order in class documentation * Change access level modifier of age variable The comment inside eat() mentions that the variable is private. Furthermore, there would be no error if the variable were used inside Dog given the current access level.
-rw-r--r--java.html.markdown6
1 files changed, 3 insertions, 3 deletions
diff --git a/java.html.markdown b/java.html.markdown
index 356ca5f1..174177c1 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -712,8 +712,8 @@ public class ExampleClass extends ExampleClassParent implements InterfaceOne,
// must be defined in a child class. Similar to interfaces, abstract classes
// cannot be instantiated, but instead must be extended and the abstract
// methods defined. Different from interfaces, abstract classes can contain a
-// concrete and abstract methods. Methods in an interface cannot have a body,
-// mixture of unless the method is static, and variables are final by default,
+// mixture of concrete and abstract methods. Methods in an interface cannot
+// have a body, unless the method is static, and variables are final by default,
// unlike an abstract class. Also abstract classes CAN have the "main" method.
public abstract class Animal
{
@@ -730,7 +730,7 @@ public abstract class Animal
// No need to initialize, however in an interface
// a variable is implicitly final and hence has
// to be initialized.
- protected int age;
+ private int age;
public void printAge()
{