Assume that you have created a class that contains a private field named myField and a nonstatic

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 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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: