exam questions

Exam 1z0-819 All Questions

View all questions & answers for the 1z0-819 exam

Exam 1z0-819 topic 1 question 141 discussion

Actual exam question from Oracle's 1z0-819
Question #: 141
Topic #: 1
[All 1z0-819 Questions]

Given:



and

  • A. The class X is not accessible in p2.
  • B. The constructor X(List) has lesser visibility rights than the constructor Y(List).
  • C. The method X.removeItem(String item) cannot be overridden by Y.removeItem(String item).
  • D. The method Y.doProcess() has higher visibility rights than the abstract method X.doProcess().
  • E. The constructor X(List) does not match the Y() constructor.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
ASPushkin
3 months, 2 weeks ago
Selected Answer: A
A class may be declared with the modifier public or default. If it is default it is visible only within its own package.
upvoted 2 times
...
d7bb0b2
6 months, 1 week ago
Selected Answer: A
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
upvoted 1 times
...
RoxyFoxy
9 months ago
Selected Answer: A
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.
upvoted 1 times
...
Ashan_Ozlov
9 months, 2 weeks ago
Selected Answer: D
The answer here is D since the method in D is public. A is wrong, we imported the class E is wrong, ran on compiler
upvoted 2 times
...
Ashan_Ozlov
9 months, 3 weeks ago
Selected Answer: E
E is the best answer
upvoted 1 times
...
Stavok
12 months ago
Selected Answer: A
A is correct
upvoted 2 times
...
KiraguJohn
1 year ago
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:
upvoted 1 times
...
KiraguJohn
1 year ago
A. default class can only be accessed within the same package
upvoted 1 times
...
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago