postfix and prefix increment or decrement operators very very confusing for me i try my best but i can not understand the basic different between them plz help me i know The prefix form first performs the increment operation and then returns the value of the increment operation. The postfix form first returns the current value of the expression and then performs the increment operation on that value.
i dont know why i can not understanding this plz help me it is very very confusing there are two codes that give same output why
first is
class LoopOperator
{
public static void main(String a[])
{
int i;
for(i=1;i<=10;i++)
System.out.println(i);
}
}
and second
class LoopOperator
{
public static void main(String a[])
{
int i;
for(i=1;i<=10;++i)
System.out.println(i);
}
}
plz help me