JavaDeploy
SiteMap
Readers Writers
Java Streams
Java Programming
Java Language
Program Flow
«Prev
Next»
Java Programming
Java Technology
Useful Technology
Acquiring Java SDK
Java Compiler
Tic Tac Toe Applet
Java Applet Viewer
Java TM Interpreter
Java SDK Conclusion
OO Programming
OO Fundamentals
Understanding Classes
Object Communication
Defining Objects
Adding Behavior Methods
OO Programming Conclusion
OO Programming - Quiz
122
Java Programs
Java Api
Applications Applets
Java main() method
Static Class Member
Command Line Arguments
Building String Characters
Standard IO Communication
Application Construction
122
Program Flow
Conditional Branching
Conditional Ternary Operator
Switch Statement
For Loops
foreach Loop
Nested Loops
while Loops
doWhile Loop
Break Statement
Control Flow Conclusion
Programming Fundamentals
Identifiers, Keywords, Literals
Java Comments
Java Data Types
Storing Data Arrays
Manipulating Text
Evaluating Expressions
Numeric Operators
Boolean Assignment Operators
Compound Operators
Java Language Conclusion
Object Classes
Inheritance Fundamentals
Break Statement - Exercise
Using Java Break Statement
Objective:
Practice using the break statement to exit an infinite loop in Java.
Exercise Grading
The full credit for this exercise is 10 points. To receive full credit, you will need to successfully create the source code for the application. You will submit your source code.
Exercise instructions
Develop a command-line application named BreakLoop that enters an infinite
do
loop and repeatedly prints the text
"I'm stuck!"
.
Then add an integer counter and use the
break
statement to bail out of the loop after looping 10 times.
What to submit:
In the text box below, cut and paste the source code for the BreakLoop application. Click the
Submit
to submit the code .
Submit