Question: Assume that you have created a class that contains a private field named myField and a nonstatic public method named myMethod(). Which of the following
Assume that you have created a class that contains a private field named myField and a nonstatic public method named myMethod(). Which of the following is true?
a. myMethod() has access to myField and can use it.
b. myMethod() does not have access to myField and cannot use it.
c. myMethod() can use myField but cannot pass it to other methods.
d. myMethod() can use myField only if it is passed to myMethod() as a parameter.
Step by Step Solution
3.51 Rating (164 Votes )
There are 3 Steps involved in it
a myMethod has access to ... View full answer
Get step-by-step solutions from verified subject matter experts
