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.

You can do it
  1. When present, package must be the first no comment statement in the file.
  2. The break statement is required in the default case of a switch selection structure.
  3. We would like to make a member of a class visible in all subclasses regardless of what package they…
  4. Objects are passed to a method by use of call-by-reference.
  5. Which key word can protect a class in package from accessibility by the classes outside the package?
  6. The keywords reserved but not used in the initial version of Java re:
  7. Which of the following methods can be used to draw the outline of a square?
  8. We can add more than one class(es) at the time of compilation Java Beans.
  9. Throwing an exception always causes program termination.
  10. The length of a string object 's1' can be obtained using the expression s1.length.
  11. To delete a file, we can use an instance of class file.
  12. In order to connect to a database through java program we must create _______-
  13. Which of the following are keywords?
  14. Consider the following statements: int x = 10, y = 15; x = ((x < y) ? (y + x) : (y - x); What will…
  15. Servlet can have ___________
  16. When we invoke repaint () for a Component, the AWT invokes the method:
  17. A final class may not have any abstract method.
  18. Which of the following statements are valid array declarations?
  19. What is error in the following class definitions? abstract class xy { abstract sum(int x, int y)…
  20. Java is fully object oriented programme.
  21. Which of the following will produce a value of 22 if x=22.9:
  22. A panel can not be added to another panel.
  23. The default case is always required in the switch selection structure.
  24. Which of the following command lines options generates documentation for all classes and methods?
  25. The check box group class is a subclass of the component class.
  26. Which of the following are the wrapper classes?
  27. If you want to assign a value of 99 to the variable year, then which of the following lines can be used…
  28. Which of the following keywords are used to control access to a class member?
  29. When we implement an interface method, it should be declared as public.
  30. Which of the following methods belong to the String class?