{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Abstract data types.pdf - Abstract data types Primitive...

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

View Full Document Right Arrow Icon
Abstract data types
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
Primitive data types In Java? 1. ? 2. ? 3. ? 4. ? 5. ? 6. ? 7. ? 8. ?
Background image of page 2
Abstract data types Remember the fundamentalsofAbstraction You don't need to know how an iPOD (or a car, or a fridge) works in order to use one! All you need to know is what operations it supports and how to use those operations abstract data types (ADTs)are a collection of data (values)and all the operations on that data A Java interface can be used to describe an ADT: the data itself is not public, so code using the class that implements the interface has no direct access to the class's internal data structures each of the methods represents an operation on the data
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
Example ADT (Java String)
Background image of page 4
Wrapper types Java supplies built-inreference types known as wrapper types , one for each of the primitive types: For example; Integer The Integer class wraps a value of the primitive type int in an object. An object of type Integer contains a single field whose type is int.
Background image of page 5

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

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}