Naming Conventions - CallByVal - OOPS
Naming Conventions - CallByVal - OOPS
/**
* */
// First world should be all in small case, and each word after that should be capitalized
/**
* First world should be all in small case, and each word after that should be capitalized
* */
public void demoFunction(){
String superSecretKey = 'Secret_Key';
}
}
“Pass by value” means when a method is called, a second copy of the parameter variable is made in
memory, and this copy is passed to the method as a parameter. This copy can be modified in the
method, but the original variable in the caller is unchanged, and the changes to the copy are lost
upon return.
Calling or invoking a method by passing a primitive value is called as Pass by value or call be value.
“In Apex, all primitive data type arguments, such as Integer or String, are passed into methods by
value.
“Pass by reference” means when a method is called, that actual variable is passed to the method.
non-primitives types classes and objects are passed by reference
Calling or invoking a method by passing the reference variable is called as Pass By Reference or call
by reference