Computer Science, asked by nishitchakma13, 8 months ago

in java determine the output of the following program:
public class Test
{
public static void main(string[] args)
{
int a = 1, b = 2;
System.out.println("Output1: " + a + b);
System.out.println("Output2: " + (a + b));
}
}

Answers

Answered by vyasananya057
4

Answer:

output 1 : 1

2

output 2: 3

Explanation:

because in statement 1 there is + sign which print a value along with b whereas in statement 2 a+b is inside bracket which gives it's total additional value

Similar questions