exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 215 discussion

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

Given:

What is the result?

  • A. 0:0 100:0
  • B. null:0 100:0
  • C. 0:0 100:200
  • D. null:null 100:null
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
carloswork
2 months, 2 weeks ago
Selected Answer: A
Answer is A. To test: class Book {int pages;} class App{ int count; public void method (Book x, int k) { x.pages = 100; k = 200; } } public class Test { public static void main(String[] args) { App obj = new App(); Book objBook = new Book(); System.out.println(objBook.pages + ":" + obj.count); obj.method(objBook, obj.count); System.out.println(objBook.pages + ":" + obj.count); } }
upvoted 2 times
...
iSnover
3 months ago
Selected Answer: A
The answer is the letter A. In the first line where the printing occurs, notice that we did not instantiate the value of "objBook.pages" and "obj.count", as they are int, the default value of this type of variable is 0, so we have already eliminated answers B and D. even passing the "obj.count" in the "method" method, its value does not change because it is an instantiation variable in the App class and not its value remains 0 and it is in the second "println" in the second place, and the only answer that has "0:0" in the first line and "0" in the second place of the second line is the letter A.
upvoted 2 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