Download presentation
Presentation is loading. Please wait.
Published byΧείρων Κοσμόπουλος Modified over 6 years ago
1
Announcements Exam 1 Grades Posted on Blackboard
2
Iteration Iteration (Looping): Performing a Series of Statements Multiple Times until Some Condition Is Met. Eliminates the Need for Redundant Coding or Method Calls Many Ways to Loop in JAVA
3
The while Loop Syntax: while (condition) statement; while (condition)
{ statement; }
4
while Example final int MAX = 100; int counter = 0;
while (counter < MAX) { System.out.println( counter); counter++; }
5
Example while Loop int numEmployees,curNum = 0;
System.out.print(“Enter Number of Employees: “); numEmployees = scan.nextInt(); if (numEmployees > 0) { while (curNum < numEmployees) System.out.println( “Welcome to CorpLand!” ); curNum++; }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.