Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Salesforce by (11.9k points)

Does Apex support the concept of lambdas?

Ultimately, I am trying to DRY up some really repetitive code in my tests, so I'd love to be able to pass functions around, something like this (C#-esq).

public static TestMethod void some_test_method(){

  Arrange( ()=>

    // some setup stuff


  Act( ()=>

    // test action




1 Answer

0 votes
by (32.1k points)
Apex doesn't have lambdas, it also doesn't have anonymous classes. You'll have to compulsorily stick to declared classes. Apex doesn't support Java interfaces and abstract classes.

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.1k users

Browse Categories