X hits on this document

91 views

0 shares

0 downloads

0 comments

24 / 46

© S. Uchitel, 2004

24

Dot operator: Examples

circle1.perimeter() and circle1.area()

method calls on object circle1

Return doubles (aprox. 6.28 and 3.14)

circle1.colour and circle1.diameter

Refers to string “red” and double 2.

In practice, accessing fields is less common.

<<instanceOf>>

Circle

colour:String

diameter:double

perimeter():double

area():double

cirlce1:Circle

colour = “red”

diameter = 2

perimeter():double

area():double

Document info
Document views91
Page views91
Page last viewedFri Dec 02 23:16:38 UTC 2016
Pages46
Paragraphs816
Words2901

Comments