Home

What is the correct answer?

4

The use of protected keyword to a member in a class will restrict its visibility as follows:

A. Visibility only in the class and its subclasses in the same package.

B. Visibility only inside the same package.

C. Visibility in all classes in the same package and subclasses in other packages.

D. Visibility only in the class where it is declared.

Correct Answer :

C. Visibility in all classes in the same package and subclasses in other packages.


Related Questions

The break statement is required in the default case of a switch selection… It is an error if a class with one or more abstract methods is not explicitly… It is perfectly legal to refer to any instance variable inside of a static… Java is fully object oriented programme. We can over load methods with differences only in their return type. Which of the following control expressions are valid for an if statement? Which of the following are keywords? putValue(...) method takes _____________________- Servlet has ___________ Any class may be inherited by another class in the same package. The length of a string object 's1' can be obtained using the expression… Throwing an exception always causes program termination. Which of the following keywords are used to control access to a class… All the bitwise operators have the same level of precedence in Java. Which of the following are the wrapper classes? Frames and applets cannot be used together in the same program. Which of the following methods can be used to draw the outline of a square? If a=10 and b= 15, then the statement x =(a>b)?a:b; assigns the value… Session bean To delete a file, we can use an instance of class file. Submit button always fires doPost(...) We can add more than one class(es) at the time of compilation Java Beans. Every method of a final in class is implicitly final. What is java -g used for? forName() is a static factory method Any method in a supper class can be over ridden in its subclass. Consider the following statements: int x = 10, y = 15; x = ((x < y)… Give file is a file object, which of the following are legal statements… JSP files creates ________________ If a=10 and b= 15, then the statement x =(a>b)?a:b; assigns the value…