What will be the output of the following Java program?

class comma_operator

{

public static void main(String args[ ])

{

int sum = 0;

for(int i = 0, j = 0; i < 5 & j < 5; ++i, j = i + 1)

sum += i;

System. out. println(sum);

}

}

1
10
2
6
3
14
4
compilation error

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation