Polymorphism and some notes

5 0 0
                                    

Polymorphism in the program refers to the methods that can take different forms while maintaining its structure. And we have been doing this when we introduced the overriding methods. The overriding method can change the implementation body of the overridden method while retaining the structure of that method.

Hiding Fields means the name in the variable in the subclass is the same in the super class which is called shadowing if they do have of the same type but if different type, the general term is hiding fields.

Note that you can use the keyword super if you want to invoke either the method or the field  or the constructor of the super class.

Object class is the mother of all super class. It has some predefined methods that you can use.

The final keyword can be used in a method or a class as well. If used in a method, that method can be change or overridden. If used in a class, that class cannot be subclass. That means that the class declared as final is immutable or cannot be change like the String class.

Java ProgrammingWhere stories live. Discover now