nerdexam
Oracle

1Z0-811 · Question #16

1Z0-811 Question #16: Real Exam Question with Answer & Explanation

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

Object-Oriented Programming Principles

Question

Given public class App { int num; public int add(int x) { num = num + x; return num; } public void add(int x) { num = num + x; } public static void main (String[] args) { App obj = new App(); obj.add (100); int ans = obj.add(100); System.out.println (obj.num); } } What is the result?

Options

  • A300
  • B100
  • C200
  • DA compilation error occurs.

Unlock 1Z0-811 to see the answer

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

#Method Overloading#Method Signature#Return Type Rules#Compilation Error
Full 1Z0-811 Practice