in Education by
Can a class be declared with a protected modifier. (a) True (b) False This question was posed to me by my college professor while I was bunking the class. I need to ask this question from Access Control in section Classes and Methods 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 choice is (b) False For explanation: Protected class member (method or variable) is like package-private (default visibility), except that it also can be accessed from subclasses. Since there is no such concept as ‘subpackage’ or ‘package-inheritance’ in Java, declaring class protected or package-private would be the same thing.

Related questions

0 votes
    How can a protected modifier be accessed? (a) accessible only within the class (b) accessible only within ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 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
    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
    In order to restrict a variable of a class from inheriting to subclass, how variable should be declared? ( ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of the following modifier means a particular variable cannot be accessed within the package? (a) private ... 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 one of the following is not an access modifier? (a) Public (b) Private (c) Protected (d) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which is the modifier when there is none mentioned explicitly? (a) protected (b) private (c) public ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is true about protected constructor? (a) Protected constructor can be called directly (b) Protected ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these method of String class can be used to test to strings for equality? (a) isequal() ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these keywords can be used to prevent inheritance of a class? (a) super (b) constant (c) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these class can be used to implement the input stream that uses a character array as the source ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these transfer protocol must be used so that URL can be accessed by URLConnection class object? (a ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
...