I'm having a small doubt.
In a class there are 2 constructors. From each constructor we are calling a same Private method loadPriceMap()
(But with different conditions).
public class PriceCalculator {
List<Account> accList;
List<Product2> prodList;
public PriceCalculator(List<Account> accListParm) {
accList= accListParm;
loadPriceMap();
}
public PriceCalculator(List<Product2> productListParm) {
prodList= productListParm;
loadPriceMap();
}
private void loadPriceMap() {
// TO DO : If the class was instantiated with a list of Product2 objects,
// then do something. else If the class was instantiated with a list of
//Account objects, then do other thing
}
My question is, can we differnitate that from which constrouctor this private method is being called?