错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Object-Oriented Programming

  • Joshua Crotts

摘要

This chapter is divided into two halves. In the first half, we begin to introduce the basics of object-oriented programming.We start off simple with small classes that contain only immutable fields. The complexity gradually increases as we mix in mutability and aliasing. This chapter also describes the implementation of several data structures that mimic those from the Collections framework, including ArrayList, LinkedList, HashSet, and maps. In the second half, we expand on the details of object-oriented programming by describing interfaces and inheritance. Interfaces ascribe behaviors and characteristics to classes, whereas inheritance denotes “IS-A” relationships across classes. We conclude the chapter by demoing a practical application of object-oriented programming and class design by writing a small programming language.