MCQ
Single Best Answer
Not Set
QGiven the following piece of code:
class Person{
public int number;
}
public class Test{
public void doIt(int i , Person p){
i = 5;
p.number = 8;
}
public static void main(String args[]){
int x = 0;
Person p = new Person();
new Test().doIt(x, p);
System.out.println(x + " " + p.number);
}
}
What is the result?
ID: #2182
Java Constructor and Methods
886 views
Question Info
#2182Q ID
Not SetDifficulty
Java Constructor and MethodsTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option A
Explanation
0 8
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic