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

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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!