{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

13InterfacesWrappersLarge

13InterfacesWrappersLarge - Lecture Set#13 Interfaces 1 2...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CMSC 131 Fall 2007 Jan Plane (Adapted from Bonnie Dorr) Lecture Set #13: Interfaces 1. Interfaces 2. Wrappers CMSC 131 Fall 2007 Jan Plane (Adapted from Bonnie Dorr) 1 Code Re-use circle6 Many operations recur in programming circle6 sorting circle6 max / min (These operations may apply to strings, numbers, etc.) circle6 Desirable: one implementation! circle6 Less coding circle6 Less likely to have typos circle6 Easier maintenance of code
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 CMSC 131 Fall 2007 Jan Plane (Adapted from Bonnie Dorr) 2 Polymorphism circle6 Using an interface we can create one variable that can reference objects of different types (i.e. UMStudent variable referencing CSMajor, CEMajor or PsychMajor) circle6 This form of “generalization” is called polymorphism circle6 Hallmark of OO languages circle6 Allows application of same code to objects of different types circle6 Polymorphism: “A variable that takes on many shapes.” circle6 Interfaces: one mechanism Java provides for polymorphism circle6
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern