Computer Science, asked by bollywoodmusic64, 8 months ago

what will be the output of the following code
int a=10,b=20;
if(a<b)
a=100;
b=200;
system.out.print(a+" "+b);​

Answers

Answered by Anonymous
0

Answer:

class Test {

int a = 10;

static int b = 20;

public

static void main(String[] args)

{

Test t1 = new Test();

t1.a = 100;

t1.b = 200;

Test t2 = new Test();

System.out.println("t1.a =" + t1.a + " t1.b =" + t1.b);

System.out.println("t2.a =" + t2.a + " t2.b =" + t2.b);

}

}

Option

A) t1.a=100 t1.b=200

t2.a=10 t2.b=200

B) t1.a=10 t1.b=200

t2.a=10 t2.b=200

C) t1.a=100 t1.b=200

t2.a=10 t2.b=20

D) t1.a=100 t1.b=200

t2.a=100 t2.b=200

Similar questions