Salesforce Fact #784 | Min Integer value in apex
How to use the min Integer value in apex?
Suppose we need to use the minimum Integer value in apex. Now, the minimum value is -2147483648. We get an error if we try to directly assign it to a variable. So, here's the workaround:
Integer i = -2147483648; // Illegal integer
Integer i = -2147483647-1; //this works
Reference: One of the problems on https://www.apexsandbox.io/
Comments
Post a Comment