PolymorphismTheability of a language tohave duplicate methodnames in an inheritancehierarchy and to applythe method that is appro-priate for the object towhich the method isapplied262Chapter 8High-Level Programming LanguagesThe fields in a record have traditionally been accessible to all by default;the fields in a class are usually private by default. That is, none of the fields(data) and subprograms of an object of a particular class can be accessedby an object of another class unless the field is markedpublic. If a classneeds to make a method available to be called by an object of anotherclass, the class must explicitly specify that the method ispublic.privateand publicare called access modifiers. They specify whether ornot code outside the class can access a class’s fields. Some languages haveadditional access codes that further modify what code can access a class’sfields. The class’s methods that others use to modify the class’s variablesare marked public
This is the end of the preview.
access the rest of the document.