class WhileDemo { public static void main(String[] args){ int count = 1; while (count < 11) { System.out.println("Count is: " + count); count++; } } }
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
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"?
Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
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.
Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
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