Upload
graham-smith
View
613
Download
5
Embed Size (px)
DESCRIPTION
Short PeopleSoft PeopleCode quiz by Graham Smith
Citation preview
What is the value of &x ?
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.
What is the value of &x ?
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.
What is the value of &x ?
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.
What are the values of &f.value and &g.value ?
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.
What is the value of &a and &b ?
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.
What is the value of &p ?
What is the value of &p ?
Answer: &p = 1Methods pass primitives by value.
What is the value of &r ?
Answer: &r = “xyz”Methods pass objects by reference
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.