/* * NOT a legal kotlin program -- it will not compile * problem is at "bb=6". Params to funcs cannot be changed * That said, it is really only the pointer that cannot be * changed. For instance, when passing a list into function * can change the list contents (if the list is mutable) * @author ggtowell * @created: Aug 1, 2021 */ fun main() { val a: Int=5 b(a) println(a) val q = mutableListOf(1,2,3,4) println(q) bb(q) println(q) } fun b(bb: Int) { println(bb) bb=6 println(bb) } fun bb(qq: MutableList) { qq += 3 }