Using Data Types
often
Objects are called
ways to hide
data type value
complexity
Objects : holds a abstract data types : Abts
the variable name refers to the object
has its own set of
properties leg Strings
.
: concatenate . . . ) Data type : set of values and operations
on those values
examples of objects
V
set of values Operations primitive boolean , int double
Data type types :
, ,
. . .
color 24 bits get red component, brighten > these values directly map to machine
Picture of colours get / set color of pixel Ciij )
array
representation / follow machine
2D
string sequence of character length ,
substring , compare instructions ( building blocks of objects)
✓
construct a new object creates space for an object objects combine types to
perform specific
•
keyword new ( invokes constructor method ) tasks ( they process other types of data)
name of data type to specify which type of object
◦
Apply an
operation not
initialized ,
•
use name of object ( specify)
dot ( invoke method )
use
operator
•
^
•
use name of the method Cto
specify operation) dot
operator
string : An ADT Object ) for text processing
•
basis for text processing
set of values of Unicode characters
sequence
• =
•
has an API :
Application Programming Interface
with each other
way for 2 to communicate coffers service to
a computer programs
> a
or more
other pieces of
>
API
specification :
describes how to use such an interface software )
e.
g. Gene finding algorithm
, Image processing
color Data type
•
set of values ( RGB representation ) : 2563 values
of red, and blue scale of
quantify amount
green on a 0 255
-
instance methods
( modify objects to do something )
colour)
• luminance determines the readibility of text on a screen ( effective brightness of a
•
difference in luminance between 2 colours should be ≥ 128
•
grayscale : when all three R G and B values are the same
,
picture Data type
of
2D
array colour objects (
pixels )
◦ -
OOP :
Natural vehicle for
studying abstract
models of the real
world .