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
ManvithaManvitha 

Apex method splitting

Hi all , 
 I have one large method which i need to split it into two ,have one doubt 
public static void method1( List<Contact> conList, Set<ID> accountIdSet, Set<ID> OrgId){

performing some acction1
{
//
}
method2(conList,accountIdSet,OrgId);
}

public static void method2( List<Contact> conList, Set<ID> accountIdSet, Set<ID> OrgId){
performing some action2
{
//
}
}


since I am calling method2 in method 1 will the parameter are same or will it differs in method 1 and method 2 ?
means will same contactlist is passed in mtehod 2 as that on mthod 1 ..Please help 
​​​​​​​TIA
Shri RajShri Raj
The parameters in method2 will be the same as those in method1, as you are passing the same conList, accountIdSet, and OrgId variables in the call to method2 from method1
Amidou CisseAmidou Cisse
Yes, the same conList parameter will be passed to method2 as in method1. The same holds true for accountIdSet and OrgId. When you call method2 from method1, you are passing the exact same arguments that were passed to method1, to method2.