Algorithms and OOD (CSC 207 2013F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Overview
Admin
Exam Questions
Soln': Parameterize a class definition ("Generics")
class ListOf
ListOf
/**
the first element or after the last element).
*/
public interface ListOf
/**
/**
/**
// Removing Elements /**
// Iterating Lists /**
/**
/**
/**
/**
// Other operations
/**
/**
/**
/**
Continuing the example
ListOf<Integer> grades;
ListOf<Student> csc207;
ListOf<Object> randomCrapInSamsOffice;
...
grades.prepend(5);
csc207.prepend(5); // COMPILATION ERROR! 5 is not of the appropriate type
Professor SamR = ...;
csc207.prepend(SamR); // COMPILATION ERROR! SamR is not a student
ListOf<Person> grinnellcs;
grinnellcs.prepend(SamR); // OKAY, Profesor is a subtype of person, whether or
// not most students believe that claim
grinnellcs.prepend(new Student("A", "A", "A");
Beyond our own design: The collections API
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Copyright (c) 2013 Samuel A. Rebelsky.

This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this
license, visit http://creativecommons.org/licenses/by/3.0/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.