Home     Blog

Override

Sometimes a subclass inherits a method from a superclass that doesn’t quite fit its needs. Perhaps the subclass inherited twenty methods and just one of them wasn’t quite right.

In that case, the subclass would override that method by redefining that method itself.

This override does not affect the method as defined in the superclass. Override

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
Follow Will.Spencer on

Leave a Reply

Related Posts

  • Java Class

    A Java class is a group of Java methods and variables. Each Java source code file can contain one public class. The name of this public class must match the name of the Java source code file. If the public class is called “ballistics,” then the filename would be “ballistics.java.” Example Java Class class Ammunition [...]...


  • Inheritance

    Inheritance is what happens when a subclass receives variables or methods from a superclass. It is also when one class passes down its properties to another class. The main reason for inheritance is reusability. Distinguishing a new class from an existing class is called derivation. The old class is referred to as the base class [...]...


  • Java Method

    A Java method is a set of Java statements that can be included inside a Java class. Java methods are similar to functions or procedures in other programming languages. There are many different types of Java methods: Final Method Public Method Private Method Package Method Instance Method Protected Method Static Method Main Method The Main [...]...