You need to sign in to do that
Don't have an account?
how to write "for loop" in apex controller ??
hi
Could some advice me how to write "for loop" in apex code,
I know "for loop" is very basic thing but I don know I cant make it.....
this is copy of my controller
-----------------------------------------------------------
public double getRandomNumber() {
for (double i = 0, j = 0; i < 10; i++) {
double ran =Math.round(Math.random()*100);
return ran(i+1);
}
-----------------------------------------------------------
I know I can do it one by one, but using "for loop" should be better for my study
please kindly show me how to make it ?
thanks
The docs have a specific section on the different types of loops you can construct :
http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_loops.htm
thanks david !!
I didnt know there is such useful docs