'Why onCreate() remembers value of local varaible?

From working with all other languages functions don't remember stuff that are in them between function calls. So why is it that value of myVariable is being remembered? How many times is onCreate() actually being called? Is this function somehow being transformed into Class to allow remembering variables by storgin them as Properties?

class MainActivity : ComponentActivity() {

  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    var myVariable = "Hello "  //Hello you you you

    setContent {
      Text(myVariable, modifier = Modifier.clickable(onClick = {
        myVariable += "you "
        println(myVariable)
      }))
    }

  }

}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source