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

48. Which of the following statements are true? a. Information hiding is achieve

ID: 3724734 • Letter: 4

Question

48. Which of the following statements are true?

a. Information hiding is achieved by restricting access to class members via keyword public.

b. The private members of a class are directly accessible to the clients of a class.

c. None of the above are true.

d. Methods and instance variables can both be either public or private.

49. When must a program explicitly use this reference?

a. Accessing a private variable.

b. Accessing a public variable.

c. Accessing a local variable.

d. Accessing an instance variable that is shadowed by a local variable.

50. Constructors: (Select all that apply)

a. When overloaded, can have identical argument lists.

b. When overloaded, are selected by number, types and order of types of parameters.

c. Initialize instance variables.

51. Set methods are also commonly called ________ methods and get methods are also commonly called ________ methods.

a. query, mutator

b. accessor, mutator

c. mutator, accessor

d. query, accessor

52. Composition is sometimes referred to as a(n) ___________.

a. many-to-one relationship

b. one-to-many relationship

c. has-a relationship

d. is-a relationship

53. Instance variables declared final do not or cannot:

a. be modified after they are initialized.

b. cause syntax errors if used as a left-hand value.

c. be initialized.

d. None of the above.

Explanation / Answer

If you post more tha 1 question, as per chegg guidelines I have to solve only 1 question.

Ques 48. Answer : (c), (d)

To hide information, we should use private insteas of public.

The private members of a class are not directly accessible to the clients of a class

So, they are not true. Hence, option (c) is correct.

Methods and instance variables can be any of the three : public, private, protected

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