exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 26 discussion

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

Given:

and

Which four identifiers from the Foo and Bar classes are visible at line 1? (Choose four.)

  • A. e
  • B. f
  • C. A
  • D. j
  • E. d
  • F. c
  • G. i
  • H. B
  • I. h
  • J. g
Show Suggested Answer Hide Answer
Suggested Answer: ABDH 🗳️

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
c47d39c
6 months, 2 weeks ago
I ran this code...A,B,H, are correct,,no compiletime error..i am failing to justify the forth one
upvoted 1 times
...
d7bb0b2
1 year ago
public class Foo { static final int A = 0; public static final int B = 0; private static final int C = 0; int d = 0; protected int e = 0; public int f = 0; private int g = 0; public void foo(int h){ int i = 0; } } IN OTHER PACKAE ONLY ACCESS: public void foo(int j) { System.out.println(B); System.out.println(e); System.out.println(f); System.out.println(j); }
upvoted 1 times
...
RoxyFoxy
1 year, 3 months ago
I tested this code: public class Bar extends com.foo.Foo{ @Override public void foo(int j){ System.out.println(super.B+" "+new Bar().e+" "+new Bar().f+ " "+ j); } public static void main(String[] args) { Bar bar = new Bar(); bar.foo(5); }} The output is: 0 0 0 5, so the correct answer: A B D H (with identifiers: e, f, j, B)
upvoted 2 times
...
Stavok
1 year, 6 months ago
Selected Answer: ABDH
ABDH is correct
upvoted 2 times
...
aruni_mishra
1 year, 7 months ago
Answer: ABDH e: Protected, visible outside package by subclass only f: public j: overridden function's parameter B: public
upvoted 1 times
...
Mukes877
1 year, 7 months ago
Selected Answer: ABDH
e,f,J,B are visible at line 1 because they are public and protected other will not because whether they are private or Default So correct is ABDH
upvoted 2 times
...
SuperDabicho
1 year, 9 months ago
Selected Answer: ABDH
tested. default/package variables won't be visible. and h is the parameter for the Foo class constructor, not for Bar's constructor.
upvoted 2 times
...
pikosss
1 year, 10 months ago
Selected Answer: ABEG
update*
upvoted 1 times
pikosss
1 year, 10 months ago
A-B-D-E
upvoted 1 times
...
...
pikosss
1 year, 10 months ago
Selected Answer: ABHI
tested
upvoted 1 times
pikosss
1 year, 10 months ago
A-B-D-E
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