X hits on this document

150 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 views150
Page views150
Page last viewedFri Jan 20 14:20:57 UTC 2017
Pages46
Paragraphs816
Words2901

Comments