• Post Reply Bookmark Topic Watch Topic
  • New Topic

Value Type v Reference Types  RSS feed

 
Mark Do
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Questions based on the code:
1. Identify all of the actual parameters in the code provided.
(Is it just i, j iArray and jArray)???

2. Identify all of the formal parameters in the code provided.

3. What is displayed in the third println statement?
i = 11, j = 2001

4. What is displayed in the fifth println statement?
iArray = 6 7 2001 9 10, jArray = 6 7 2001 9 10
 
Tushar Goel
Ranch Hand
Posts: 934
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Identify all of the actual parameters in the code provided.


iArray and jArray


2. Identify all of the formal parameters in the code provided.


theArray
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there such a thing as a value type? Please look through the Java Language Specification and check. Also do you call those formal parameters and actual parameters? I thought they were called arguments and parameters.
I presume somebody else has given you that code, and not as an example of good practice. That String method with the multiple += operations is a prime candidate for slow performance. Use a StringBuilder instead.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!