CS 1723-001 Data Structures
Fall 2001 -- Lectures for Week 4


Strings, 2-dimensional Arrays, and
Extending Classes (Inheritance)

Week's Objectives Related to Stacks:
  1. Study Strings briefly.
  2. Go over one specific example of 2-dimensional arrays.
  3. Study how classes are extended.

Details About the Objectives:

  1. Strings. In many languages, a string is just an array of char. In Java, a String is a separate class whose instances behave like an array of char.

    A Java string (from now on just called string) holds a sequence of 0 or more characters. If there are n, then the chars in the string are indexed (numbered) from 0 to n-1 inclusive.

    A string instance has various methods, including the following:

  2. 2-dimensional arrays: A sample program is here .

  3. Extending classes (inheritance): An example related to extending classes is here.


Revision date: 2001-09-16. (Please use ISO 8601, the International Standard.)