Oracle
1Z0-851 · Question #38
1Z0-851 Question #38: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #38. The question stem and answer options stay visible for context.
Question
Given: public class Base { public static final String FOO = "foo"; public static void main(String[] args) { Base b = new Base(); Sub s = new Sub(); System.out.print(Base.FOO); System.out.print(Sub.FOO); System.out.print(b.FOO); System.out.print(s.FOO); System.out.print(((Base)s).FOO); } } class Sub extends Base {public static final String FOO="bar";} What is the result?
Options
- Afoofoofoofoofoo
- Bfoobarfoobarbar
- Cfoobarfoofoofoo
- Dfoobarfoobarfoo
- Ebarbarbarbarbar
- Ffoofoofoobarbar
- Gfoofoofoobarfoo
Unlock 1Z0-851 to see the answer
You've previewed enough free 1Z0-851 questions. Unlock 1Z0-851 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.