Dale - Computer Science Illuminated 289

Dale - Computer Science Illuminated 289 - 262 Chapter 8...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Polymorphism The ability of a language to have duplicate method names in an inheritance hierarchy and to apply the method that is appro- priate for the object to which the method is applied 262 Chapter 8 High-Level Programming Languages The 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 accessed by an object of another class unless the field is marked public . If a class needs to make a method available to be called by an object of another class, the class must explicitly specify that the method is public . private and public are called access modifiers. They specify whether or not code outside the class can access a class’s fields. Some languages have additional access codes that further modify what code can access a class’s fields. The class’s methods that others use to modify the class’s variables are marked
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/13/2011 for the course CSE 1550 taught by Professor Marianakant during the Fall '10 term at York University.

Ask a homework question - tutors are online