exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 81 discussion

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

Given:

What is the result?

  • A. 100 200 : 0 0 :
  • B. 100 200 : 100 0 :
  • C. 100 200 : 100 200 :
  • D. 0 0 : 100 0 :
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
iSnover
Highly Voted 1 year, 2 months ago
Selected Answer: A
The correct is A, because m2 object variables x and y are not assigned so, these have default zero values. so the answer is 100:200:0:0 and you can test the code: public class MyField { int x; int y; public void doStuffy(int x, int y) { x = x; y = this.y; } public void display () { System.out.print(x + " " + y + " : "); } public static void main(String[] args) { MyField m1 = new MyField (); m1.x = 100; m1.y = 200; MyField m2 = new MyField(); m2.doStuffy(m1.x, m1.y); m1.display(); m2.display(); } }
upvoted 7 times
carloswork
1 year, 1 month ago
Thanks
upvoted 1 times
...
...
AhmadTechie
Most Recent 2 weeks, 6 days ago
Answer is A
upvoted 1 times
...
DarGrin
2 months ago
Selected Answer: A
A is correct
upvoted 1 times
...
winfred_lu
5 months, 1 week ago
Selected Answer: A
100 200 : 0 0 :
upvoted 1 times
...
Kolodets
7 months, 3 weeks ago
doStuff method only assign local variables, not affecting instance variables
upvoted 1 times
...
Vicky_65
8 months, 1 week ago
Selected Answer: A
A is the correct one
upvoted 1 times
...
odzio33
9 months, 4 weeks ago
Selected Answer: A
100 200 : 0 0 : public class MyField { int x; int y; public void doStuffy(int x, int y) { x = x; y = this.y; } public void display () { System.out.print(x + " " + y + " : "); } public static void main(String[] args) { MyField m1 = new MyField (); m1.x = 100; m1.y = 200; MyField m2 = new MyField(); m2.doStuffy(m1.x, m1.y); m1.display(); m2.display(); } }
upvoted 1 times
...
Rajeevkuamr
11 months, 1 week ago
A. 100 200 : 0 0 because x =x; if this.x=x then answer is B
upvoted 3 times
...
Rajeevkuamr
11 months, 1 week ago
B. 100 200 : 100 0
upvoted 1 times
...
haisaco
11 months, 3 weeks ago
Selected Answer: A
Answer is A.
upvoted 1 times
...
akbiyik
1 year ago
100 200 : 0 0 :
upvoted 1 times
...
carloswork
1 year, 1 month ago
As below (iSnover comment), Answer is A.
upvoted 1 times
...
Joker74
1 year, 3 months ago
Selected Answer: A
m2 object variables x and y are not assigned so, these have default zero values. so the answer is 100:200:0:0
upvoted 4 times
shivkumarx
1 year, 2 months ago
Tested and agreed
upvoted 1 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