CS 131 LECTURE 6 - VARIANT AND TAGGED RECORD TYPES


VARIANT RECORDS

Variant Record Type Declaration Syntax
Semantic Rule:
Important Points:


VARIANT RECORD EXAMPLE

Students Package Specification
Important Point:


VARIANT RECORD LAYOUT

Students Record Layout

Student Record Diagram

Advantages Of Variant Records
Important Points:


VARIANT RECORD PUT PROCEDURES

Students Package Body
Important Points:


CONSTRAINED AND UNCONSTRAINED VARIANT RECORDS

Terminology:
Important Points:


VARIANT RECORD ALLOCATION

Unconstrained Records:
Constrained Records:


VARIANT RECORD ASSIGNMENTS

Variable Declaration:
Illegal Assignment Statement:
Legal Assignment Statements:
Important Points:


TAGGED TYPES

Terminology:
Important Points:
Syntax Rules:


TAGGED RECORD EXAMPLE

Student Package Specification
Students Package Body
Important Point:


DERIVED RECORD EXAMPLE

Undergraduates Package Specification
Undergraduates Package Body


OBJECT-ORIENTED PROGRAMMING

Encapsulation
Genericity
Inheritance
Polymorphism


INHERITANCE

Major Issues:
Inheritance For Specialization Example
Important Point:


POLYMORPHISM

Compile-Time Polymorphism (Overloading)
Run-Time Polymorphism (Dispatching)


/ Top of Page /