What is different about passing an array to a method rather than passing a primitive type to a method?

What will be an ideal response?


Because an array name is a reference, you cannot assign another array to it using the = operator, nor can you compare two arrays using the == operator. Additionally, when you pass an array (that is, pass its name) to a method, the receiving method gets a copy of the array's actual memory address. This means that the receiving method has access to, and the ability to alter, the original values in the array elements in the calling method.With a primitive, the method gets a copy of the variable's value, not the address of the value, so the original value cannot be altered by the method.

Computer Science & Information Technology

You might also like to view...

That part of a program where a particular declaration of a word provides its meaning is called the ____ of that declaration.

A. scope B. duration C. lifetime D. access level

Computer Science & Information Technology

What is the difference between pirated and counterfeit software?

A. Counterfeit is fake technology products; pirated is invisible technological cameras placed online. B. Pirated is the unauthorized use, duplication, distribution, or sale of copyrighted software; counterfeit is software that is manufactured to look like the real thing and sold as such. C. Counterfeit is the unauthorized use, duplication, distribution, or sale of copyrighted software; pirated is software that is manufactured to look like the real thing and sold as such. D. Pirated is stolen software used to hack into a company's classified material; counterfeit is a fake version of firewall software.

Computer Science & Information Technology

?To place an object with absolute positioning, use either the top/left coordinates or the bottom/right coordinates but not all four coordinates at the same time.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

While performing disk and file maintenance on the company file server, you determine a user in the accounting department has been accidentally saving documents to all shared folders on the file server. The user’s computer was recently passed to her from another user in the company, and according to company policy, the user should have access only to the accounting share.   Which of the following best describes this situation?

A. The user bypassed the security of the file server. B. The principle of least privilege was not followed. C. The firewall on the server is disabled. D. The firewall on the user’s computer is disabled.

Computer Science & Information Technology