Code :class WhileDemo { public static void main(String[] args){ int count = 1; while (count < 11) { System.out.println("Count is: " + count); count++; } } }
Printable View
Code :class WhileDemo { public static void main(String[] args){ int count = 1; while (count < 11) { System.out.println("Count is: " + count); count++; } } }
You tell us. What do you think? What exactly do you mean by "keyword"?
if you mean key words in the java syntax like while,for,if,switch and so on then no it is'nt because it is created by you, if you are using an IDE, all the java key words will be illistrated by bold text and a change of font colour, in eclipse this would be purple. the key word in your code would be while.
hope that helped,
The color of the text depends on the settings, and is a pretty poor way to identify the keywords, imo. Also, that program contains several such keywords, not just "while". Also also, this seems like a homework assignment to me, so be careful not to just do somebody else's homework for them.
I think I get it now
int "count" is created and set it to 1, then if count is less than 11 print text to screen......plus the count, increase count by 1.
Also this isn't homework, it's an example from the tutorials.
The while and do-while Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)
Sory from now on I'll support people to work it out for them selfs with a few hints