function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Matheus SalesMatheus Sales 

How i execute this method ? - Newbie

public class ContactAndLeadSearch {

    public static List<List<SObject>> searchContactsAndLeads( String nome)
    {   
        List<List<sObject>> searchList = [FIND :nome IN All Fields RETURNING Contact(FirstName,LastName),Lead(FirstName,LastName)];
        return searchList;         
    }
}
SonamSonam (Salesforce Developers) 
You can directly call this function name:
searchContactsAndLeads(pass value to the variable)

reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_static.htm