exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 28 discussion

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

Given:

What is the result?

  • A. 3 4 5 6
  • B. 3 4 3 6
  • C. 5 4 5 6
  • D. 3 6 4 6
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
dya45792
Highly Voted 5 years, 3 months ago
Antwort C, ist richtig : 5 4 5 6
upvoted 13 times
...
v323rs
Highly Voted 5 years, 2 months ago
The correct answer is C, "5 4 5 6"
upvoted 8 times
...
din_sub077
Most Recent 4 weeks, 1 day ago
Selected Answer: C
5 4 5 6
upvoted 1 times
...
vic88
4 months, 1 week ago
Selected Answer: C
5 4 5 6. static variable is class level vs. instance variable.
upvoted 1 times
...
AhmadTechie
1 year, 4 months ago
Answer is C => as i is static variable it always hold updated value that is shared by all instances
upvoted 1 times
...
Dolly2901
1 year, 8 months ago
static variable is class level variable and it is shared to all objects of that class. and whenever its value gets updated it will update to all objects. so correct ans is 5 4 5 6
upvoted 2 times
...
Vicky_65
2 years ago
Selected Answer: C
The right one is C
upvoted 1 times
...
anmoldev2java
2 years, 4 months ago
Selected Answer: C
c is ans
upvoted 2 times
...
RoxyFoxy
2 years, 7 months ago
Selected Answer: C
X x1 = new X(); X x2 = new X(); x1.i = 3; // i is static (class variable), i = 3 x1.j = 4; // j is an instance variable, so for x1, j is 4 x2.i = 5; // i is updated from 3 to 5; x2.j = 6; // j is an instance variable, so for x2 j is 6
upvoted 5 times
...
Andrei_Nicolae
2 years, 9 months ago
Selected Answer: C
C is correct
upvoted 2 times
...
hexadecimal82
2 years, 9 months ago
Selected Answer: C
C is correct
upvoted 2 times
...
hexadecimal82
2 years, 9 months ago
Selected Answer: D
C is the correct answer. Changing a static variable value changes it in all instances of the class
upvoted 2 times
...
SSJ5
4 years ago
Correct answer is C
upvoted 2 times
...
Stewart125
4 years, 6 months ago
Option C is correct. Reason is because variable i is declared static so when; x2.i = 5 is called, all X objects i values contain the new assigned value.
upvoted 5 times
...
SamAru
4 years, 9 months ago
Agreed, Option C is correct!
upvoted 1 times
...
mete23
5 years, 2 months ago
The correct answer is C public class X { static int i; int j; public static void main(String[] args) { X x1 = new X(); X x2 = new X(); x1.i = 3; x1.j = 4; x2.i = 5; x2.j = 6; System.out.println(x1.i + " " + x1.j + " " + x2.i + " " + x2.j); } }
upvoted 3 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