Assume you have created a class named MyClass and that is contains a private field named
myField and a nonstatic public method named myMethod(). Which of the following is
true?
a. myMethod() has access to and can use myField
b. myMethod() does not have access to and cannot use myFeild.
c. myMethod() can use myField but cannot pass it to other methods.
d. myMethod() can use myField only in myField is passed to myMethod() as a
parameter.

Respuesta :

Answer:

a. myMethod() has access to and can use myField.

Explanation:

Logic programming is a kind of programming which is largely based on formal logic.  The statement are written in logical forms which express rules about the domain. In the given scenario the my method will have access to my field which is private field. My method non static public field can also use my field class.