1.

What is the output of this program?

class calclution
{
int p;
int q;
calclution(int K, int L)
{
p = K;
q = L;
}
void calc(calclution n)
{
n.p *= 2;
n.p /= 2;
}
}
public class Result
{
public static void main(String args[])
{
calclution obj = new calclution(50 , 20);
obj.calc(obj);
System.out.println(obj.p + " " + obj.q);
}
}

A. 20 30
B. 50 20
C. 40 10
D. 20 50
E. 10 10
Answer» C. 40 10


Discussion

No Comment Found

Related MCQs