Originally posted by Surya B:
What do you think gets printed out(Don't compile and run :-))
1)
class Test
{
public static void main(String[] args)
{
int i=3;
print3(i,++i,++i + ++i);
}
static void print3(int a, int b, int c)
{
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
}
2)
class Test
{
public static void main(String[] args)
{
int i=3;
print3(i,++i,i+++i++);
}
static void print3(int a, int b, int c)
{
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
}
Answer of (1) is 3,4,11 and for (2) is 3,4,9