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
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.