1. Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class?






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.25 am
    The private access modifier limits access to members of the same class. Option A, B, D, and E are wrong because protected are the wrong access modifiers, and final, static, and volatile are modifiers but not access modifiers.
Show Similar Question And Answers
QA->A statement followed by two assumptions I and II is given. You have to consider the statement to be true even if it seems to be at variance from commonly known facts. You are to decide which of the given assumptions can definitely be drawn from the given statement. Indicate which one of the four given alternatives is correct ? Statement : If more encouragement is given to Sports, Indians will win more gold medals at the Olympic Games. Assumptions : I. Indians do not win gold medals. II. More enc....
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->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.....
QA->Average height of 10 students in a class is 150 cm. A boy of height 160 cm left the class and a boy of height 148 cm is admitted. Then what is the average height of the students in the class now?....
QA->There are 50 students in a class. In a class test 22 students get 25 marks each, 18 students get 30 marks each. Each of the remaining gets 16 marks. The average mark of the whole class is :....
MCQ->Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class?....
MCQ->Which of the following statements are correct about the structure declaration given below? struct Book { private String name; protected int totalpages; public Single price; public void Showdata() { Console.WriteLine(name + " " + totalpages + " " + price); } Book() { name = " "; totalpages = 0; price = 0.0f; } } Book b = new Book(); We cannot declare the access modifier of totalpages as protected. We cannot declare the access modifier of name as private. We cannot define a zero-argument constructor inside a structure. We cannot declare the access modifier of price as public. We can define a Showdata() method inside a structure.....
MCQ->Which of the following are necessary for Run-time Polymorphism? The overridden base method must be virtual, abstract or override. Both the override method and the virtual method must have the same access level modifier. An override declaration can change the accessibility of the virtual method. An abstract inherited property cannot be overridden in a derived class. An abstract method is implicitly a virtual method.....
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->Which of the following statements are correct about the C#.NET code snippet given below? namespace IndiabixConsoleApplication { class index { protected int count; public index() { count = 0; } } class index1: index { public void increment() { count = count +1; } } class MyProgram { static void Main(string[] args) { index1 i = new index1(); i.increment(); } } } count should be declared as public if it is to become available in the inheritance chain. count should be declared as protected if it is to become available in the inheritance chain. While constructing an object referred to by i firstly constructor of index class will be called followed by constructor of index1 class. Constructor of index class does not get inherited in index1 class. count should be declared as Friend if it is to become available in the inheritance chain.....
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