Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What is a privacy leak in Java? A. When a programmer forgets to make his/her ins

ID: 3704197 • Letter: W

Question

What is a privacy leak in Java?

A. When a programmer forgets to make his/her instance variables private allowing an outside user to modify them

B. When a class has class type instance variables and returns a reference to them allowing an outside user to modify them

C. When a person breaks into the main server room and steals secret files

D. When a class has class type instance variables but never returns a reference to them

Which of the following is not a way to avoid a privacy leak?

A. Make all instance variables class types

B. Make all instance variables primitive types

C. Only return clones of any object that you return

D. Only use instance variables that have no mutator methods

A. When a programmer forgets to make his/her instance variables private allowing an outside user to modify them

B. When a class has class type instance variables and returns a reference to them allowing an outside user to modify them

C. When a person breaks into the main server room and steals secret files

D. When a class has class type instance variables but never returns a reference to them

Which of the following is not a way to avoid a privacy leak?

A. Make all instance variables class types

B. Make all instance variables primitive types

C. Only return clones of any object that you return

D. Only use instance variables that have no mutator methods

Explanation / Answer

1) When a class has class type instance variables and returns a reference to them allowing an outside user to modify them 2) Make all instance variables class types

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote