Multiple Choice Question

Quiz Guidelines

 

QID: 
437
Tags: 
Question: 

Consider the following code:

public class MyClass {
  protected int value = 10;
}

Which of the following statements are correct regarding the field value?

Select 1 option

A. It cannot be accessed from any other class.
B. It can be read but cannot be modified from any other class. 
C. It can be modified but only from a subclass of MyClass.
D. It can be read and modified from any class within the same package or from any subclass of MyClass.

Q&A Set: