Oracle
1Z0-803 · Question #135
1Z0-803 Question #135: Real Exam Question with Answer & Explanation
The correct answer is C: hello 17. See the full explanation below for the reasoning.
Question
Given: class X { String str = "default"; int ivalue = 17; X(String s) { str = s; } X(int i) { ivalue = i; } void print() { System.out.println(str + " " + ivalue); } public static void main(String[] args) { new X("hello").print(); new X(92).print(); } } What is the result?
Options
- Adefault 17
- Bhello 92
- Chello 17
- Ddefault 92
Community Discussion
No community discussion yet for this question.