nested if statements

0 Sylvester Chikoti · April 23, 2017
hi
if i put if statement inside for loop, would'nt i nest if statement?
something like:
for(int i=0; i<10;i++){
if(i==1){
//bla bla bla
else if(i==9)
//bla bla bla
}
}

Post a Reply

Replies

Oldest  Newest  Rating
+1 Nicholas Eason · April 26, 2017
I don't understand the question? If you put an if statement inside of a for loop, then you have an if statement?
for(int i=0; i<10;i++){
if(i==1){
//bla bla bla
else if(i==9)
//bla bla bla
}
}


Things within '{}' are just blocks. Almost anything can be within them.
  • 1

Java / Android Development

118,062 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator