summaryrefslogtreecommitdiffhomepage
path: root/java.html.markdown
diff options
context:
space:
mode:
authorDamaso Sanoja <narsil.dev@gmail.com>2015-10-17 08:35:18 -0430
committerDamaso Sanoja <narsil.dev@gmail.com>2015-10-17 08:35:18 -0430
commit172797939be42567d1e554c448eee1074238dbee (patch)
treeee71847dd94e5f75f648406e89a60ad744eb95af /java.html.markdown
parent86544181686161ad39dd9f7dd626347816d77b84 (diff)
parentde3cbda46276cd820cba13c645136f2b53ba3d3a (diff)
Merge branch 'master' of github.com:damasosanoja/learnxinyminutes-docs into Spanish-Branch
Diffstat (limited to 'java.html.markdown')
-rw-r--r--java.html.markdown15
1 files changed, 13 insertions, 2 deletions
diff --git a/java.html.markdown b/java.html.markdown
index 35ec57d8..fa5cf8fc 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -250,7 +250,7 @@ public class LearnJava {
// If statements are c-like
int j = 10;
- if (j == 10){
+ if (j == 10) {
System.out.println("I get printed");
} else if (j > 10) {
System.out.println("I don't");
@@ -285,7 +285,18 @@ public class LearnJava {
// Iterated 10 times, fooFor 0->9
}
System.out.println("fooFor Value: " + fooFor);
-
+
+ // Nested For Loop Exit with Label
+ outer:
+ for (int i = 0; i < 10; i++) {
+ for (int j = 0; j < 10; j++) {
+ if (i == 5 && j ==5) {
+ break outer;
+ // breaks out of outer loop instead of only the inner one
+ }
+ }
+ }
+
// For Each Loop
// The for loop is also able to iterate over arrays as well as objects
// that implement the Iterable interface.