15

PeopleCode Variable Scope Quiz

Embed Size (px)

DESCRIPTION

Short PeopleSoft PeopleCode quiz by Graham Smith

Citation preview

Page 1: PeopleCode Variable Scope Quiz
Page 2: PeopleCode Variable Scope Quiz

What is the value of &x ?

Page 3: PeopleCode Variable Scope Quiz

What is the value of &x ?Answer: &x = 2Variables are passed into local functions by reference.&x and &n both point to the same variable.

Page 4: PeopleCode Variable Scope Quiz

What is the value of &x ?

Page 5: PeopleCode Variable Scope Quiz

What is the value of &x ?Answer: &x = 4Variables are passed into local functions by reference.&x exists in and outside the local function and &n is just a pointer to &x. &x is therefore momentarily set to 2.

Page 6: PeopleCode Variable Scope Quiz

What is the value of &x ?

Page 7: PeopleCode Variable Scope Quiz

What is the value of &x ?Answer: &x = 2Variables are passed into external functions by reference.Local function variable &x only exist in the external function.

Page 8: PeopleCode Variable Scope Quiz

What are the values of &f.value and &g.value ?

Page 9: PeopleCode Variable Scope Quiz

What are the values of &f.value and &g.value ?

Answer: &f.value = “g” &g.value = “g”Objects are assigned by reference.Both &g and &f point to the same string variable.

Page 10: PeopleCode Variable Scope Quiz

What is the value of &a and &b ?

Page 11: PeopleCode Variable Scope Quiz

What is the value of &a and &b ?Answer: &a = “a” &b = “b”Primitives are assigned by value.Both &a and &b are discreet variables.&b is set the value of &a and does not point to &a.

Page 12: PeopleCode Variable Scope Quiz

What is the value of &p ?

Page 13: PeopleCode Variable Scope Quiz

What is the value of &p ?

Answer: &p = 1Methods pass primitives by value.

Page 14: PeopleCode Variable Scope Quiz

What is the value of &r ?

Answer: &r = “xyz”Methods pass objects by reference

Page 15: PeopleCode Variable Scope Quiz

Written by Graham Smith

http://i-like-trains.blogspot.co.uk/

I found this helpful – I hope you did too.

Please feel free to comment, correct, add to and share freely.