APCS Unit 2_ Using Objects Review - Ajay Gandecha
APCS Unit 2_ Using Objects Review - Ajay Gandecha
OBJECTI
Physical properties Fields
Actions they can perform Methods
How they are created Constructors
Example
FlE
ME HO
returns
Taxi new Taxi new Taxi inputs newly
created
reference y f TT 9 object
name new sane hare
data assignat 4 initiate
type operator keyword as nan
of type fields
Example
new Type C j
name method C
Math string
Classy B used to define
for objects
a
type
typeName
Eapital
Xcode
as A
house
Blueprint
class object
Ex Ex
string mystring Ha Io Math abs 8.2
01234
s 7 I 8.21 8.2
mystring length
is 5
Math pwr 2,3
23 8
myStringindexoff'e I
D
myStringindexoff'a 1
D
Math Sart 9
if 3
myString substring 2,3 M Z
Math random
mystringcompareTo Bye D G m 0.9082567
My string
Escape Choracles
avon
Tine HI Yaacsias
My string is Ajay