Thursday, October 30, 2008

What is the default value of struts-config.xml validate attribute?

What is the default value of struts-config.xml validate attribute?

validate="true">




default value for validate is true

Why does it print 0??

Why does it print 0??

int i =0;
i = i++;
System.out.println(i);

Why does it print 0 and not 1???????



Answer is :

i = i++;(here doing the post increment which will be 1 after that line.but assigning on that line to i , which holds value "0")
So, the output is 0