Skip to main content

Kotlin Notes

Loop annotation

  1. loop@ .. @loop is a goto label used in the Kotlin which will move the statement of execution to the loop@

    loop@ for (number in 1 .. 10) {
               println("Number: $number")
               for (i in 1 .. 6) {
                 if (i == 4)
                    break @loop
                 println("Inner number: $i") 
              
    }
          }

    • The output will be

      Number: 1
      Inner number: 1
      Inner number: 2
      Inner number: 3

     

Comments

Popular posts from this blog

Novice stuff

Hello there!! Today i am just going to scribble all i think in my mind about staring as a Novice Android programmer all the way up to the Android developer.. It's going to be a lots of fun!! https://developer.android.com - all tucked in. Now started learning Gradle (the builder) what is a DSL - Domain specific language? Google says it means the programming language is specific to an application domain. May be because of the "building tool" - it's ok for now to about this, this much, uh?! with Gradle there are 2 things.. i don't know.. what is with the `doLast` and ` Projects & Tasks Projects - a library/JAR/web app/Zip of an app/etc., Task - a piece of work in the build Well.. hello.. now comes the two things again.. Project Object and Script Object If in anyways a project is defined in gradle script and if you get any error that says: project ":blah" is not found in your root project include that project name ...