in Education by
In order to restrict a variable of a class from inheriting to subclass, how variable should be declared? (a) Protected (b) Private (c) Public (d) Static The question was posed to me by my college director while I was bunking the class. This intriguing question originated from Inheritance in chapter Inheritance of Java Select the correct answer from above options Java questions and answers, Java questions pdf, Java question bank, Java questions and answers pdf, mcq on Java pdf, Java questions and solutions, Java mcq Test , Interview Java questions, Java Questions for Interview, Java MCQ (Multiple Choice Questions),Core Java Questions, Core Java MCQ,core java interview questions for experiencedcore java interview questions for 3 years experience,java programming questions,core java interview questions for freshers,java interview questions and answers for freshers, java programming questions and answers pdf, java interview questions for beginners

1 Answer

0 votes
by
 
Best answer
The correct answer is (b) Private Explanation: By declaring variable private, the variable will not be available in inherited to subclass.

Related questions

0 votes
    If super class and subclass have same variable name, which keyword should be used to use super class? ( ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    A class member declared protected becomes a member of subclass of which type? (a) public member (b) ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    A class member declared protected becomes a member of subclass of which type? (a) public member (b) ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    All the variables of class should be ideally declared as? (a) private (b) public (c) protected (d ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    If a class inheriting an abstract class does not define all of its function then it will be known as ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Can a class be declared with a protected modifier. (a) True (b) False This question was posed to ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these keywords cannot be used for a class which has been declared final? (a) abstract (b) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these keywords is used to refer to member of base class from a subclass? (a) upper (b) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these cannot be declared static? (a) class (b) object (c) variable (d) method This ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of this keyword can be used in a subclass to call the constructor of superclass? (a) super ( ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is the process of defining a method in a subclass having same name & type signature as a method ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these is correct way of calling a constructor having no parameters, of superclass A by subclass B? ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Static members are not inherited to subclass. (a) True (b) False This question was addressed to me ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Standard output variable out' is defined in which class? (a) Void (b) Process (c) Runtime (d) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is an instance variable of class httpd? (a) port (b) cache (c) log (d) All of ... java programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
...