Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

parameters arguments

variables: any declaration
			val someVariable: String = "some variable"

parameters: variables within method/class declaration
			fun someMethod (someParameter: String) {...}
            class SomeClass (someParameter: String){...}
            
arguments: variables passed into a method/class call
			var somevariable = someMethod(someArgument)
            val someClass = SomeClass(someArgument)
            
property: variable declared within a class
			class SomeClass(val someParameter: String){
                //use parameter in class as property
                ...
            }
            
/*
Note
Source: 
https://developer.android.com/codelabs/
basic-android-kotlin-compose-classes-and-objects?
continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-classes-and-objects#6

"If constructor doesn't specify whether the properties are
mutable or immutable, it means that the parameters are
merely constructor parameters instead of class properties.
You won't be able to use them in the class, but simply
pass them to the superclass constructor."
*/
class SubClass(deviceName: String, deviceCategory: String) :
    SuperClass(name = deviceName, category = deviceCategory) {
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #parameters #arguments
ADD COMMENT
Topic
Name
2+1 =