There are some "global" functions in scala, for example:
print
println
classOf
format
The first 2 are actually Console's singleton methods, the last comes from java.lang.String.format.
I believe there are some more, may somebody list all of them, or point out where I can find corresponding API documentation ?
Global functions are custom functions that can be called from custom actions configured for request, change, or custom schedules, whenever necessary.
Yes. Not everything is an object in C++. Save this answer.
A method is a function defined in a class and available from any instance of the class. The standard way to invoke methods in Scala (as in Java and Ruby) is with infix dot notation, where the method name is prefixed by the name of its instance and the dot ( . )
A global variable is one declared at the start of the code and is accessible to all parts of the program. Since Java is object-oriented, everything is part of a class. The intent is to protect data from being changed. A static variable can be declared, which can be available to all instances of a class.
They're all defined in the scala.Predef
object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With