My code is used as part of two large versions and interacts with an external interface. In one version, a new API was added (I need to call a new method).
I would like to prevent the saving of two versions of my code and use the if statement:
If VersionX
Do Method1()
If VersionY
Do Method2()
Assuming that method2()this is a new function that I need to call, is there a way that code can only compile at run time (does that mean that if I started the system VersionX, there would be no problems with compilation and exceptions, although method 2()it does not exist there)?
source
share