nerdexam
Oracle

1Z0-829 · Question #34

1Z0-829 Question #34: Real Exam Question with Answer & Explanation

Sign in or unlock 1Z0-829 to reveal the answer and full explanation for question #34. The question stem and answer options stay visible for context.

Java Object-Oriented Approach

Question

Given: public class App { public int x = 100; public static void main(String[] args) { int x = 1000; App t = new App(); t.myMethod(x); System.out.println(x); } public void myMethod(int x) { x++; System.out.println(x); System.out.println(this.x); } } What is the result?

Options

  • A1001 1001 1000
  • B101 101 1000
  • C100 100 1000
  • D1001 100 1000

Unlock 1Z0-829 to see the answer

You've previewed enough free 1Z0-829 questions. Unlock 1Z0-829 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.

Topics

#Variable scope#Pass-by-value#this keyword#Instance variables
Full 1Z0-829 Practice