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();
}
}
This section is not available anymore. Please use the main Exam Page.1z0-808 Exam Questions
Log in to ExamTopics
Sign in:
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.
iSnover
Highly Voted 1 year, 9 months agocarloswork
1 year, 8 months agoAhmadTechie
Most Recent 7 months, 1 week agoDarGrin
8 months, 3 weeks agowinfred_lu
11 months, 4 weeks agoKolodets
1 year, 2 months agoVicky_65
1 year, 3 months agoodzio33
1 year, 4 months agoRajeevkuamr
1 year, 5 months agoRajeevkuamr
1 year, 5 months agohaisaco
1 year, 6 months agoakbiyik
1 year, 7 months agocarloswork
1 year, 8 months agoJoker74
1 year, 9 months agoshivkumarx
1 year, 9 months ago