Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A list of scala "global" functions?

Tags:

scala

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 ?

like image 205
luikore Avatar asked Nov 27 '09 04:11

luikore


People also ask

What are global functions?

Global functions are custom functions that can be called from custom actions configured for request, change, or custom schedules, whenever necessary.

Can a class use a global function?

Yes. Not everything is an object in C++. Save this answer.

What do you call a function defined in a block in Scala?

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 ( . )

What is global function in Java?

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.


1 Answers

They're all defined in the scala.Predef object.

like image 64
Ken Bloom Avatar answered Sep 28 '22 07:09

Ken Bloom