You need to sign in to do that
Don't have an account?
anil kumar devunoori
Why Salesforce allowed to call NON VOID method like VOID method?
public class ApexMethodBehaviourTest {
public static Integer staticNum = 0;
public static Integer getNumber1(Integer i1){
staticNum = i1;
return i1;
}
public static Integer getNumber2(Integer i2){
getNumber1(i2);
return staticNum;
}
public Integer getNumber3(Integer i3){
return i3;
}
public Integer getNumber4(Integer i4){
getNumber3(i4);
return i4;
}
}
In above code, Salesforce allows us to call NON VOID methods getNumber3(i4); and getNumber1(i2); like VOID methods!
There is another post where Raj and myself discussed and found no documentation about this topic online.
Any thoughts/ideas will be appreciated much.
public static Integer staticNum = 0;
public static Integer getNumber1(Integer i1){
staticNum = i1;
return i1;
}
public static Integer getNumber2(Integer i2){
getNumber1(i2);
return staticNum;
}
public Integer getNumber3(Integer i3){
return i3;
}
public Integer getNumber4(Integer i4){
getNumber3(i4);
return i4;
}
}
In above code, Salesforce allows us to call NON VOID methods getNumber3(i4); and getNumber1(i2); like VOID methods!
There is another post where Raj and myself discussed and found no documentation about this topic online.
Any thoughts/ideas will be appreciated much.
https://developer.salesforce.com/forums/ForumsMain?id=9060G0000005gzvQAA