A is correct, so X is default access, cannot be accessed outside package.
protected contructor, instance variable and method can access because has protected acces
X is not public and cannot be accessed from outside package (even if we use import statement). X is in p1 and Y is in p2. X has default access = package private. Regarding E , X(list) and Y() are two different things. Y is the subclass and X(list) must not match the constructor of its subclass. X(list) is the constructor with one parameter that overloads X()...nothing to do with Y(). Y () depends on X(list) but not viceversa. So I think E is not correct.
Default. When we don't use any keyword explicitly, Java will set a default access to a given class, method or property. The default access modifier is also called package-private, which means that all members are visible within the same package but aren't accessible from other packages:
A. default class can only be accessed within the same package
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ASPushkin
3 months, 2 weeks agod7bb0b2
6 months, 1 week agoRoxyFoxy
9 months agoAshan_Ozlov
9 months, 2 weeks agoAshan_Ozlov
9 months, 3 weeks agoStavok
12 months agoKiraguJohn
1 year agoKiraguJohn
1 year ago