-
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);
}
}
-
- 20 30
- 50 20
- 40 10
- 20 50
- 10 10
Correct Option: B
Output: 50 20