1. You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 02 Jun 2017 01.26 am
    Access modifiers dictate which classes, not which instances, may access features. Methods and variables are collectively known as members. Method and variable members are given access control in exactly the same way. private makes a member accessible only from within its own class protected makes a member accessible only to classes in the same package or subclass of the class default access is very similar to protected (make sure you spot the difference) default access makes a member accessible only to classes in the same package. public means that all other classes regardless of the package that they belong to, can access the member (assuming the class itself is visible) final makes it impossible to extend a class, when applied to a method it prevents a method from being overridden in a subclass, when applied to a variable it makes it impossible to reinitialise a variable once it has been initialised abstract declares a method that has not been implemented. transient indicates that a variable is not part of the persistent state of an object. volatile indicates that a thread must reconcile its working copy of the field with the master copy every time it accesses the variable. After examining the above it should be obvious that the access modifier that provides the most restrictions for methods to be accessed from the subclasses of the class from another package is C - protected. A is also a contender but C is more restrictive, B would be the answer if the constraint was the "same package" instead of "any package" in other words the subclasses clause in the question eliminates default.
Show Similar Question And Answers
QA->If you have a Power point show you created and want to send using E-mail to another teacher you can add the show to your E-mail message as an______....
QA->Correct sentences among the following are: ) The tea is too hot that I cannot drink (2) Work hard, lest you should miss the chance (3) Unless you study well, you will fail (4) Unless you study well, you will pass....
QA->If you want to visit sambhar lake; to which state you will go?....
QA->If you want to visit sambhar lake, to which state you will go?....
QA->Two statements are given followed by two conclusions I and II. You have to consider the two statements to be true even if they seem to be at variance from commonly known facts. You have to decide which one of the given conclusions is definitely drawn from the given statements. Statement : All virtuous persons are happy. No unhappy person is virtuous. Conclusions : I. Happiness is related to virtue II. Unhappy person is not virtuous.....
MCQ->You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?....
MCQ->You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?....
MCQ->What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package?....
MCQ->You are the administrator of Windows 2000 Server network. On each server you format a separate system partition and a separate boot partition as NTFS. Several months later you shut down one of the computers for maintenance. When you try to restart the computer you receive the following error message "NTLDR is missing, press any key to restart". You want to install a new NTLDR file on the computer but you do not want to loose any settings you made since the installation. What should you do?....
MCQ->You want to improve the TCP transmission speed of a Windows 2000 Server computer. You also want to remove an unused registry key. You use Regedit32 to edit the registry of the Windows 2000 Server. You insert a value in the registry named TCPWindowSize, and you remove the unused key. You restart the computer, but the computer stops responding before the logon screen appears. You want to return the computer to its previous configuration. What should you do?....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution