As I know Apex is a combination of Java and C# languages (maybe this list should contain more languages).
Speaking about System.runAs
, documentation says that it is a method. It looks like it is a static method of System
class. But how can then we send written code in block of this method?
System.runAs(u){
//any lines of code are here
}
Normally we can't pass code lines to method, so it doesn't look like method. So we can't call System.runAs
as "method".
I didn't find something relevant in Java. Is it an anonymous method, implementation of some interface with anonymous class? Is it something specific only for Apex ?
What is a name of construction System.runAs(u){}
?