{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

03JavaConstructs - CMSC 132 Object-Oriented Programming II...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CMSC 132: Object-Oriented Programming II Object-Oriented Programming & Java Language Constructs Department of Computer Science University of Maryland, College Park
Background image of page 1

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

View Full Document Right Arrow Icon
2 Review of Java Language Constructs Basic elements Primitive types, variables, constants, operators If-else, switch, while, for Classes Object instances Creating objects with new Object references The null reference Instance data, class (static) data Methods Parameters, return values, polymorphism
Background image of page 2
3 Review of Java Language Constructs Inheritance Base class, derived class, super Method overriding (vs. overloading) Abstract methods Up- and down-casting , getClass() , instanceof avoid overuse of these... leads to bad designs Interfaces 1D Arrays Creating, indexing Exceptions Try-catch blocks
Background image of page 3

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

View Full Document Right Arrow Icon
4 Iterator Interface Iterator Common interface for all Collection classes Used to process all elements in collection Properties Can remove current element during iteration Works for any collection
Background image of page 4