Computer Science, asked by aishowrya, 1 year ago

Java Programming: Access Control
Which of this access specifier must be used for classes, so that it can be inherited by another sub class? 1) Public 2) Private 3) Protected 4) None of the above


siddhartharao77: Public

Answers

Answered by Arshiya6
1
hii frnd,

your answer will be "public"
this access specifier can be inherited from any sub class.

hope it helped u
please mark as brainliest if it helps u ☺

Manisankar1: answer is protected
Answered by anuj
0
HEya friend,

The answer is (3)PROTECTED
A protected member is accessible within all classes in the same package and within subclasses in other package

public can be accessed  every where according to the POLP we choose protected


HOPE IT HELPS!!!!!!!!!!


anuj: i will edit and program to it
anuj: *add
siddhartharao77: Waiting for it
siddhartharao77: Shall I give the edit option?
anuj: i have
siddhartharao77: Okk ..
siddhartharao77: Its okk.. I want to leave this topic by saying that "If that answer is not correct, then it won't be brainliested. But I would like to say that "Only public members can be accessed out of class, private members are not accessed by external classes.Protected members access only by its sub classes". Still my answer is public.
siddhartharao77: Bye
anuj: so u agree that protected members access only by its sub class
anuj: inbox
Similar questions