St4nley
Member
- Apr 13, 2013
- 469
- 76
Code:
package pkgdo.dowhile;
public class DoDoWhile {
//DO WHILE STATEMENT
/* THIS STATEMENT IS CLAIMING TO ADD COUNT + 1 UNTILL COUNT IS LESS THAN 11
* IT MUST LOOP ONCE AT LEAST SINCE WHILE IS AT THE BOTTON OF THE CODE*/
public static void main(String[] args){
int count = 1;
String hello = "word";
do {
Print("Count is: " + count);
count++;
} while (count < 11);
}
static void Print(String echo) {
System.out.println(echo);
if (count > 8) {
Print("Void NEXT");
}else{
Print("Continue With Next Terms");
}
}
}
In my if statement the variable count which has been established in my main class isnt being recognized in this instance.
How come?
Thanks!